Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs on a component’s content being used as its view #270

chasenlehara opened this Issue Jun 28, 2018 · 0 comments


None yet
3 participants
Copy link

chasenlehara commented Jun 28, 2018

When a component has no view or an empty view defined, it’ll render its content as its view.

Here’s an abbreviated example from the forums:

  tag: "can-el",
  ViewModel: {
    hovMessage: {
        default: "I'm from can-el",
  tag: "can-simple",
  view: "<can-el>{{hovMessage}}</can-el>",
  ViewModel: {
    hovMessage: {
        default: "I'm from can-simple",

<can-simple></can-simple> will then render:

    I'm from can-el

@phillipskevin says this is a feature, so I think this should be documented in the view docs and maybe also mentioned on the main can-component page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.