Thursday, 8 August 2013

Cannot access property on undefined viewmodel javascript

Cannot access property on undefined viewmodel javascript

I am getting the following error:
Uncaught TypeError: Cannot read property 'property' of undefined.
Undefined is a javascript viewmodel. This error does not occur when
running locally, or when deployed to a different environment hosted in the
exact same way.
However, I have noticed that the definition of this specific viewmodel is
not making it into main-built.js (using Durandal and Node.js) In the
router config I have the following:
router.mapRoute('viewmodel', 'viewmodels/viewmodel.vm', 'view model',
false);
Is there anything else I need to do to get the definition of this
viewmodel into main-built.js? As far as I can tell, all I should need to
do is the router mapping.

No comments:

Post a Comment