I've got an Ember.js app that uses the Ember.Router structure.
My app structure looks something like
window.App = Ember.Application.create {
#Truncated idea of app, not including application controller or any of that
MainController = Ember.Controller.extend()
MainView = Ember.View.extend
templateName: 'main-template'
So controllers and view are extended and not created on application creation. There are then routes that connect outlets
Router: Ember.Router.extend
root: Ember.Route.extend
main: Ember.Route.extned
route: '/'
connectOutlets: (router, event) ->
router.get('applicationController').connectOutlet('main')
I need to bind a <select>
tag to a set of values. Ember.Select
looks like a good way to do this so I add a controller and view extension for the select
MySelectController: Ember.ArrayController.extend
contents: [{id:1,title:'test'},{id:2,title:'test2'}]
MySelectView: Ember.Select.extend
contentBinding: this.get('controller')
contentValuePath: 'id'
contentLabelPath: 'title'
This doesn't work. I get an error about the this.get('controller')
when I try to include inside a view with {{#view App.MySelectView}}
How do I do this right?