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.

enter image description here

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

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -