extend

  • function
 

Extends the can.Component constructor function.

can.Component.extend(proto)

Extends the can.Component constructor function with prototype properties and methods.

Parameters

  1. proto {Object}

    An object set as the prototype of the constructor function. You will typically provide the following values on the prototype object.

Note that inheriting from components works differently than other CanJS APIs. You can't call .extend on a particular component to create a "subclass" of that component.

Instead, components work more like HTML elements. To reuse functionality from a base component, build on top of it with parent components that wrap other components in their template and pass any needed viewModel properties via attributes.