Created
September 1, 2012 09:30
-
-
Save Nopik/3568228 to your computer and use it in GitHub Desktop.
Named outlets in Ember views
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
.navbar.navbar-fixed-top | |
%ul.dropdown-menu | |
%li.nav-header | |
Projects | |
%li.divider | |
{{outlet projectNames}} | |
%li.divider |
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
App.Router = Ember.Router.extend | |
root: Ember.Route.extend | |
index: Ember.Route.extend | |
route: '/' | |
connectOutlets: (router)-> | |
projects = App.Project.fetch_all() #returns empty array, fill content after ajax returns | |
router.get( 'applicationController' ).connectOutlet( { name: 'projectsMenu', context: projects, outletName: 'projectNames' } ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment