Riding #each loop in steering wheel

I have a steering code script such as inside my ascx file.

<script id="ex" type="text/x-handlebars-template">
 {{#each model}}
   {{#if condition}}
  //Need to Break, Dont know how to do that
   {{/if}}
 {{/each}}
</script>
+5
source share
1 answer

Just pass this object to a JavaScript function, follow the necessary logic, and return it.

<script type= "text/javascript">
    Handlebars.registerHelper("ifSet", function (model) {        
        var count = 0;
        while (count < model.length) {            
    //    if (logic Condition){
    //      return 'Success';  or Break;             
    //    }
        }
        return;
    });     
</script>

<script id="ex" type="text/x-handlebars-template">
 {{ifSet model}}
</script>
+2
source

All Articles