Created
July 3, 2012 13:54
-
-
Save limptwiglet/3039823 to your computer and use it in GitHub Desktop.
App router setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Z = Ember.Application.create({ | |
ready: function () { | |
this.initialize(); | |
} | |
}); | |
Z.ApplicationController = Ember.Controller.extend(); | |
Z.ApplicationView = Ember.View.extend({ | |
templateName: 'application' | |
}); | |
Z.DashController = Ember.ArrayController.extend(); | |
Z.DashView = Ember.View.extend({ | |
templateName: 'dash' | |
}); | |
Z.store = DS.Store.create({ | |
revision: 4, | |
adapter: DS.RESTAdapter.create({ | |
namespace: 'api' | |
}) | |
}); | |
Z.Router = Ember.Router.extend({ | |
root: Ember.Route.extend({ | |
index: Ember.Route.extend({ | |
route: '/', | |
redirectsTo: 'dash' | |
}), | |
dash: Ember.Route.extend({ | |
route: '/user/dash', | |
connectOutlets: function (router) { | |
router.get('applicationController').connectOutlet(Z.DashView, Z.Character.find()); | |
} | |
}) | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
connectOutlets: function (router) {
router.get('applicationController').connectOutlet({
outletName: 'view',
viewClass: Z.DashView,
controller: Z.DashController,
context: Z.Character.find()
});
equal to
connectOutlets: function (router) {
router.get('applicationController').connectOutlet({
name: 'dash',
context: Z.Character.find()
});