DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
    • can-component
      • static
        • extend
      • prototype
        • ViewModel
        • events
        • helpers
        • leakScope
        • tag
        • view
        • viewModel
      • elements
        • <content>
      • special events
        • beforeremove
    • can-compute
    • can-connect
    • can-define
    • can-define/list/list
    • can-define/map/map
    • can-route
    • can-route-pushstate
    • can-set
    • can-stache
    • can-stache/helpers/route
    • can-stache-bindings
  • Ecosystem
  • Infrastructure
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Core
  • /
  • can-component
  • /
  • <content>
  • / On this page
    • <content>

      typedef

      Positions the LIGHT_DOM within a component's [can-component.prototype.template].

      • source

      <content>DEFAULT_CONTENT</content>

      When a user creates a new component in a template, the content between the tags is the LIGHT_DOM. For example, Hello <b>World</b> is the LIGHT_DOM in the following:

      <my-tag>Hello <b>World</b></my-tag>
      

      The <content> tag can be used within my-tag to position the LIGHT_DOM. For example, to position the LIGHT_DOM within an <h1>, <my-tag> could be defined like:

      Component.extend({
          tag: "my-tag",
          view: stache("<h1><content/></h1>")
      });
      

      Parameters

      1. DEFAULT_CONTENT {sectionRenderer(context, helpers)}:

        The content that should be used if there is no LIGHT_DOM passed to the component.

        The following, makes my-tag show Hi There! if no LIGHT_DOM is passed:

        Component.extend({
            tag: "my-tag",
            view: stache("<h1><content>Hi There!</content></h1>")
        });
        

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.