Copyable

Ember.Copyable Class

PRIVATE

Defined in: packages/ember-runtime/lib/mixins/copyable.js:14

Module: ember-runtime

Implements some standard methods for copying an object. Add this mixin to any object you create that can create a copy of itself. This mixin is added automatically to the built-in array.

You should generally implement the copy() method to return a copy of the receiver.

Note that frozenCopy() will only work if you also implement Ember.Freezable.

copy (deep) Objectprivate

Defined in packages/ember-runtime/lib/mixins/copyable.js:31

Required. You must implement this method to apply this mixin.

Override to return a copy of the receiver. Default implementation raises an exception.

Parameters:

deep Boolean
if `true`, a deep copy of the object should be made

Returns:

Object
copy of receiver

frozenCopyObjectdeprecatedprivate

Defined in packages/ember-runtime/lib/mixins/copyable.js:44

Use Object.freeze instead.

If the object implements Ember.Freezable, then this will return a new copy if the object is not frozen and the receiver if the object is frozen.

Raises an exception if you try to call this method on a object that does not support freezing.

You should use this method whenever you want a copy of a freezable object since a freezable object can simply return itself without actually consuming more memory.

Returns:

Object
copy of receiver or receiver

willMergeMixinprivate

Defined in packages/ember-runtime/lib/mixins/controller_content_model_alias_deprecation.js:21
Available since 1.4.0

© 2017 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://emberjs.com/api/classes/Ember.Copyable.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部