javascript - RequireJS local var not matching -
can explain why might case?
i in requirejs module has 0 dependencies. trying create singleton represents view state, avoid global variable. reason getter trying retrieve property view var not matching. there way explain going on in image?
view defined, , viewname value defined, it's somehow not picking view.mainview.

it looks you're trying check if view[viewname] defined on view, you're checking see if view[viewname] has truth-y value.
try this:
if(viewname in view) {     view[viewname] = $view; } else {     throw new error('no view matched'); } 
Comments
Post a Comment