initNavigation: [$ref: "defaultLanguage"]
navigationController: create: module: 'app/navigation/navigation_controller' args: defaultLanguage: $ref: "defaultLanguage" ready: setCurrentLanguage: [] initNavigation: [$ref: "defaultLanguage"] before: setCurrentLanguage: 'audioController.resetAudio' after: setCurrentLanguage: 'audioController.setCurrentLanguage'
initNavigation: (lang) -> self = @ activeNode = document.getElementById("nav_#{lang}") activeNode.classList.remove('grey')
new FastButton(activeNode.parentNode, (e) -> self.navigate e)
Now, I assume this is happening because the navigation and navigationController components are in no way connected. What I am looking for is something like: when the navigation is rendered call initNavigation in navigation_controller. But I feel lost in how to achieve this and suspect I should be using a completely different pattern...
Hope all this makes some sense, because I am totally new to this Inversion of Control approach and I feel I am struggling to grasp it...
Any hints in the right direction would be warmly welcomed. Thanks.
--
You received this message because you are subscribed to the Google Groups "cujojs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cujojs+un...@googlegroups.com.
To post to this group, send email to cuj...@googlegroups.com.
Visit this group at http://groups.google.com/group/cujojs.
To view this discussion on the web visit https://groups.google.com/d/msgid/cujojs/c1f2e2e6-8389-4f92-bfe4-0836562306c1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to a topic in the Google Groups "cujojs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cujojs/RbSl7QAwySU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cujojs+un...@googlegroups.com.
To post to this group, send email to cuj...@googlegroups.com.
Visit this group at http://groups.google.com/group/cujojs.
To view this discussion on the web visit https://groups.google.com/d/msgid/cujojs/CAGv6PiCW%3DdXYw1byDHvoh2eMSD-P94OvLJQZiVLpSq1ytkrBHA%40mail.gmail.com.
navigationController:
create:
module: 'app/navigation/navigation_controller'
args:
defaultLanguage: $ref: "defaultLanguage"
properties:
activeNode: $ref: 'dom!nav_#{lang}'
ready:
setCurrentLanguage: []
initNavigation: [$ref: "defaultLanguage"]
before:
setCurrentLanguage: 'audioController.resetAudio'
after:
setCurrentLanguage: 'audioController.setCurrentLanguage
Then, inside navigation_controller:
this.activeNode.classList.remove('grey')
navigation:
render:
template:
module: "text!navigation/navigation_template.html"
insert:
at: "dom.first!header"
navigationController:
create:
module: 'app/navigation/navigation_controller'
args:
defaultLanguage: $ref: "defaultLanguage"
ready:
setCurrentLanguage: []
initNavigation: [{$ref: "defaultLanguage"}, {$ref: "navigation"}]
before:
setCurrentLanguage: 'audioController.resetAudio'
after:
setCurrentLanguage: 'audioController.setCurrentLanguage'
Curious how you inverted the problem, Decio. Did you use property injection?
navigationController:
create:
module: 'app/navigation/navigation_controller'
args:
defaultLanguage: $ref: "defaultLanguage"
properties:
activeNode: $ref: 'dom!nav_#{lang}'
ready:
setCurrentLanguage: []
initNavigation: [$ref: "defaultLanguage"]
before:
setCurrentLanguage: 'audioController.resetAudio'
after:
setCurrentLanguage: 'audioController.setCurrentLanguage
Then, inside navigation_controller: