Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
{div:class=} h1.
Wiki Markup
Div
classapi-page

fluid.copy(tocopy)

{section} {column:width=70%} Performs a deep copy

Section
Column
width70%

Performs a deep copy (clone)

of

the

object

passed

in

the

argument.

{

Code Block
:javascript|borderStyle=none|bgColor=white}
javascript
bgColorwhite
borderStylenone
javascript

fluid.copy(tocopy);
{code} *

File

name:

* {{

Fluid.js

}} h2. Parameters {span:class=

Parameters

Span
classborderless-table

} |*{{tocopy}}*|

tocopy

(Object)

The

object

to

be

copied | {span} h2. Return Value {span:class=borderless-table} |*Object*| The copied object | {span} {column} {column:width=5%} {column} {column} h3. See Also {column} {section} ---- h3. Notes This function recursively copies the contents of {{tocopy}} into a new object of the same type. h3. Example {code:javascript}

copied

Return Value

Span
classborderless-table

Object

The copied object

Column
width5%

Column

See Also


Notes

This function recursively copies the contents of tocopy into a new object of the same type.

Example

Code Block
javascript
javascript

var oldModel = fluid.copy(that.model);
{code}

In

this

example,

{{

fluid.copy()

}}

is

being

used

to

preserve

a

copy

of

a

model.

This

can

be

useful

for

scenarios

where

some

kind

of

'revert'

or

'undo'

might

be

desirable.

{div}