Skip to content

Instantly share code, notes, and snippets.

@thierry-rietsch
Created October 4, 2012 10:26
Show Gist options
  • Save thierry-rietsch/3832767 to your computer and use it in GitHub Desktop.
Save thierry-rietsch/3832767 to your computer and use it in GitHub Desktop.
Stackoverflow Issue 12706031 - JS
window.App = Ember.Application.create();
App.ApplicationView = Ember.View.extend({ templateName: 'application' });
App.ApplicationController = Ember.Controller.extend();
App.BlocksView = Ember.View.extend({
tagName: 'div',
classNames: ['block'],
templateName: 'blocki'
})
App.BlocksController = Ember.ObjectController.extend();
App.testData = {
"name": "main page",
"children": [
{
"name": "Block 1",
"children": [
{ "name": "Block 1.1" },
{ "name": "Block 1.2" }
]
},
{
"name": "Block 2",
"children": [
{
"name": "Block 2.1",
"children": [
{
"name": "Block 2.1.1",
"children": [
{ "name": "Block 2.1.1.1" }
]
}
]
}
]
}
]
};
App.Router = Ember.Router.extend({
enableLogging: true,
root: Ember.Route.extend({
blocks: Ember.Route.extend({
route: "/",
connectOutlets: function(router, context) {
router.get("applicationController").connectOutlet("blocks", App.testData);
console.log("connecting blocks outlets");
}
})
})
});
App.initialize();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment