Elements and Attributes

  • page
can.elementAndAttributes  

A list of all custom elements and attributes that CanJS supports.

can.Component, can.view.attr, can.view.tag let you create custom element and attribute behavior. However, CanJS and its plugins supply the following behaviors:

Core

The following is supported by CanJS's can.mustache and can.stache templates by default:

  • can-EVENT - Specify a callback function to be called on a particular event.

    <div can-click="{doSomething item}">...</div>
    
  • can-value - Sets up two way bindings in a template.

    <input can-value="{name}"/>
    

Plugins

The following functionality is available within plugins:

  • can-autorender - Autorenders a script tag within the page as a template.

    <script type='text/stache' can-autorender>
      <my-component></my-component>
    </script>
    
  • <can-import> - Imports dependencies in a stache template using a System loader, StealJS, or AMD. This only works in templates loaded by can-autorender or imported with the system plugin.

    <can-import from="components/my-component"/>
    <can import from="helpers/stache-helpers"/>
    <my-component> {{myHelper "value"}} </my-component>