BorisMoore / jsviews

Interactive data-driven views, MVVM and MVP, built on top of JsRender templates
http://www.jsviews.com/#jsviews
MIT License
856 stars 130 forks source link

Cannot read property 'ctx' of undefined #389

Closed ainglese closed 7 years ago

ainglese commented 7 years ago

after upgrading to .87 from .85, when i try to get a helper function in a event handler:

var v = $(this).view()
v.hlp('cell')  //was working on .85
v.ctxPrm('cell')  //throws exception

the exception is thrown here:

 function contextParameter(key, value, isContextCb) {
        // Helper method called as view.ctxPrm(key) for helpers ...
        var wrapped, deps, res, obsCtxPrm,
            storeView = this,
            isUpdate = !isRenderCall && value !== undefined,
            store = storeView.ctx;

storeView is undefined

ainglese commented 7 years ago

nevermind, my fault, error was in my code.

BorisMoore commented 7 years ago

Ah, good. I thought it looked strange...