ember.js - Passing contextual components to child template though an outlet in EmberJS -
i've been having fun embers contextual components. i'd find out if there clean way have component "contexts" shared child templates through outlet.
e.g.
{{outlet foo='bar'}}
in example below ht-window component controls 3 column layout; list, details & actions. navigate between users/view & users/edit last 2 columns should update.
the functionality of these components requires pane components have reference parent window component.
i know use service this, if possible using contextual components seems cleaner.
here's code far, edit.hbs , view.hbs not have access window not work.
in app/templates/users.hbs
{{#ht-window |window|}} {{#window.header}} ...navigation {{/window.header}} {{#window.pane}} ...list {{/window.pane}} {{outlet window=window}} {{/ht-window}}
in app/templates/users/view.hbs
{{#window.pane}} ...view {{/window.pane}} {{#window.pane}} ...actions {{/window.pane}}
in app/templates/users/edit.hbs
{{#window.pane}} ...form {{/window.pane}} {{#window.pane}} ...actions {{/window.pane}}
in app/templates/components/ht-window.hbs
{{yield (hash header=(component 'ht-window-header') pane=(component 'ht-window-pane' window=this) )}}
Comments
Post a Comment