Function

capabilities (managerApiVersion, options) Capabilities public

Module: @ember/helper
managerApiVersion
String
The version of capabilities that are being used
options
The capabilities values
returns
Capabilities
The capabilities object instance

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

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

capabilities('3.23');

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

capabilities('3.23', {
  hasValue: true,
  hasDestructor: true,
});

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

3.23 capabilities

hasDestroyable

  • Default value: false

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

hasValue

  • Default value: false

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

© 2020 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://api.emberjs.com/ember/3.25/functions/@ember%2Fhelper/capabilities