Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<!DOCTYPE html>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script type="text/x-handlebars" data-template-name="application">
{{view Ember.Select content=options value=computed}}
<p><code>content</code> was initially <code>{{unbound contentInspect}}</code> and is now <code>{{contentInspect}}</code></p>
<p><code>parent</code> was initially <code>{{unbound parentInspect}}</code> and is now <code>{{parentInspect}}</code></p>
App = Ember.Application.create({});
override = function(key, value) {
if (arguments.length > 1) {
this.set("content", value);
else {
return this.get("content") || this.get("parent");
inspect = function(property) {
return function() {
return JSON.stringify(this.get(property));
App.ApplicationController = Ember.Controller.extend({
options: ["foo", "bar", "baz"],
content: null,
contentInspect: inspect("content"),
parent: "bar",
parentInspect: inspect("parent"),
computed:"content", "parent")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment