JSFiddle - React, Tailwind, and code Playground

by skane

HTML

<script src="https://raw.github.com/wycats/handlebars.js/1.0.0-rc.3/dist/handlebars.js"></script>
<script src="https://raw.github.com/emberjs/ember.js/release-builds/ember-1.0.0-rc.1.js"></script>
<script type="text/x-handlebars">
    {{view Ember.Select contentBinding="basicSelections" valueBinding="basicSelection"}}
    {{view "App.MySelectorView" contentBinding="customSelections" valueBinding="customSelection"}}
</script>

CoffeeScript

window.App = Ember.Application.create()

App.Tester = Em.Object.extend
    testfunc: () ->
        console.log "headhunta"

App.ApplicationController = Em.Controller.extend
    basicSelections: ['ted', 'bill']
    customSelections: ['tom', 'yehuda']
    basicSelection: 'ted'
    customSelection: 'tom'
    testFuncs: [App.Tester.create(), App.Tester.create()]
    
    init: () ->
        @_super()
        @get('testFuncs').invoke('testfunc')
        
    onlyTeds: (->
        selections = @get('basicSelections').filter((item) -> if item is 'ted' then return item else return)
    ).property('basicSelections')

App.MySelectorView = Em.Select.extend
    fireAjax: (->
        alert('fired')
    ).observes('controller.customSelection')