ember.js - Ember currentViewBinding on ContainerView -
i have been trying learn ember , have spent lot of time referencing discourse code base on over github. anyway, wanted implement similar modal
views method , don't understand why currentviewbinding
isn't working.
the following combination of information referenced these links:
ember.containerview
documentation: binding view display- discourse's
modal_view.js
file on github - discourse's
modal_controller.js
file on github
app.headercontroller = ember.controller.extend templatename: 'application/header' needs: ['modal'] togglelogin: -> console.log "headercontroller.togglelogin" @get('controllers.modal').show(app.loginview.create()) app.modalcontroller = ember.controller.extend show: (view) -> @set('currentview', view) app.modalview = ember.containerview currentviewbinding: 'controller.currentview' viewchanged: (-> console.log "modal view changed" ).observes('controller.currentview') app.loginview = ember.view.extend templatename: 'modal/login'
my views this:
<!-- application.hbs --> {{render header}} {{outlet}} <!-- header.hbs --> <button {{action togglelogin}}>login</button> {{render modal}} <!-- modal/login.hbs --> <h2>login form!!</h2>
when app loads, 2 console logs "modal view changed", when click {{action togglelogin}}
button in header template, nothing happens except console message "headercontroller.togglelogin".
what doing wrong or not how ember.containerview
docs meant work?
solved
update 1.0.0-rc.1
1.0.0-rc.2
!
Comments
Post a Comment