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

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -