Hi,
I have trouble with closure-dicontainer. For some unknown reason it is not resolving my dependencies. For example, I have these two react components:
goog.provide 'Menu'
class Menu
###*
@param {SubMenu} subMenu
@constructor
###
constructor: (@subMenu) ->
{div, ul} = React.DOM
@component = React.createFactory React.createClass
render: ->
div id: 'menu', ul, @subMenu.component
goog.exportSymbol 'Menu', Menu
and
goog.provide 'SubMenu'
class SubMenu
###*
@constructor
###
constructor: () ->
{div} = React.DOM
@component = React.createFactory React.createClass
render: ->
div id: 'subMenu'
goog.exportSymbol 'SubMenu', SubMenu
DiContainer created looks like this:
/**
* Factory for 'Menu'.
* @param {Object=} opt_rule
* @return {Menu}
*/
app.DiContainer.prototype.resolveMenu = function(opt_rule) {
var rule = /** @type {{
resolve: (Object),
as: (Object|undefined),
with: ({
subMenu: (SubMenu|undefined)
}),
by: (Function|undefined)
}} */ (opt_rule || this.getRuleFor(Menu));
var args = [
rule['with'].subMenu!== undefined ? rule['with'].subMenu: void 0
];
if (this.resolvedMenu) return this.resolvedMenu;
this.resolvedMenu = /** @type {Menu} */ (this.createInstance(Menu, rule, args));
return this.resolvedMenu;
};
Which is not, what I expect.
I can't see any difference between my code and code in songary repository (which I am using as inspiration). Is there any glitch?? Or how to make it work?
Thank you
Tomáš Lembacher