JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://cloud.github.com/downloads/wycats/handlebars.js/handlebars-1.0.0.beta.6.js"></script>
<script src="http://cloud.github.com/downloads/emberjs/ember.js/ember-latest.js"></script>
<script type="text/x-handlebars">
{{view App.BaseView controllerBinding="App.someController"}}
</script>
----
<script type="text/x-handlebars" data-template-name="sub-view">
{{view.name}}:
{{#if view.controller}}
I have an inherited controller
{{else}}
I can't find my controller :o(
{{/if}}
</script>
CSS
.is-foo {
background-color: red;
}
JavaScript
App = Ember.Application.create();
App.someController = Ember.Object.create({
foo: true
});
App.BaseView = Ember.ContainerView.extend({
childViews: ["withBindingView", "withoutBindingView", "explicitControllerWithBindingView"],
withBindingView: Ember.View.extend({
fooBinding: "controller.foo",
name: "view with binding with inherited controller",
templateName: "sub-view"
}),
withoutBindingView: Ember.View.extend({
name: "view without binding with inherited controller",
templateName: "sub-view"
}),
explicitControllerWithBindingView: Ember.View.extend({
controllerBinding: "parentView.controller",
fooBinding: "controller.foo",
name: "view with binding with explicit controller",
templateName: "sub-view",
})
})