-
-
Save johanvalcoog/3359873 to your computer and use it in GitHub Desktop.
EmberJS list control that can tell what was clicked
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
EvEditor = Em.Application.create({ | |
main: { componentList:[{name:'a'},{name:'b'},{name:'c'}] | |
}); | |
EvEditor.ApplicationController = Em.Controller.extend() | |
EvEditor.ApplicationView = Em.View.extend({ | |
templateName: 'application' | |
}); | |
EvEditor.ComponentListController = Ember.ArrayController.extend({ | |
removeItem: function(event){ | |
this.removeObject(event.context); | |
}; | |
}); | |
EvEditor.ComponentListView = Ember.View.extend({ | |
templateName: 'component-list' | |
}); | |
EvEditor.Router = Em.Router.extend({ | |
root: Ember.Route.extend({ | |
index: Ember.Route.extend({ | |
route: '/', | |
connectOutlets: function(router){ | |
router.get('applicationController').connectOutlet('componentList', EvEditor.get('main'componentList')) | |
} | |
}) | |
}) | |
}); | |
EvEditor.initialize() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment