-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
Description
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: https://forums.donejs.com/t/how-to-limit-event-outcome-to-element-of-origin/919/8
Component.extend({
tag: "can-el",
ViewModel: {
hovMessage: {
default: "I'm from can-el",
}
}
});
Component.extend({
tag: "can-simple",
view: "<can-el>{{hovMessage}}</can-el>",
ViewModel: {
hovMessage: {
default: "I'm from can-simple",
}
}
});<can-simple></can-simple> will then render:
<can-simple>
<can-el>
I'm from can-el
</can-el>
</can-simple>@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.