jquery - Error: view.hlp(...) is not a function in jsrender -


i using jsrender map templates in grid. calling method inside jsrender if condition below,

@section scripts{     $.views.helpers({         ismobile: function () {             return ("@ismobiledevice" == "false" && (window.innerwidth < 1200));         }     }); } 
<script type="text/x-jsrender">     {{if ~ismobile()}}         <li class="show">show</li>     {{/if}} </script> 

but getting error:

view.hlp(...) not function.

whats wrong here ?

it's difficult when post razor code. need show code loaded browser, not server code, since question client-side jsrender.

it seems ismobile helper not function. perhaps helper definition code not getting loaded in browser before running template rendering code - or there issue/bug in server code ismobile helper registered in browser, not function.


Comments

Popular posts from this blog

ruby on rails - Permission denied @ sys_fail2 - (D:/RoR/projects/grp/public/uploads/ -

c++ - nodejs socket.io closes connection before upgrading to websocket -

python - PyQt: Label not showing correct number of length -