-1 *ifCond* and *selectIf* the reason we have separate *logic-less* temperating is to remove logic out of ui representation. this helper defeats whole purpose of having handlebars. different people have different opinions on this, see the discussion on https://github.com/wycats/handlebars.js/issues/616 . I personally don't like putting it in templates.
It is better to do the necessary logic in the js/jag file and use the built in Helpers. is there any reason to not to do it this way? +1 for *for* but think it's there in new version anyway. is this one any different? if not we should just update to new Handlebars instead. On Wed, Aug 12, 2015 at 3:28 PM, Sajith Ariyarathna <[email protected]> wrote: > Hi All, > > For AppM we have implemented few custom Handlebars helpers [1]. Since they > are very helpful, we like to suggest them to add to the Caramel framework. > We suggest following 03 helpers. > > *ifCond* > > Conditional if block which can be used with a single logical expression. > ifCond helper supports ==, !=, ===, !==, <, <=, >, >=, &&, || and typeof > operators. > (see [2]) > > *for* > > Iterates over an array and iteration manner can be customized. Also, index > of the current iteration can be access as {{index}}. (see [3]) > > *selectIf* > > For the given value, outputs the result based on the specified > 'value-result' map. Very similar to the switch-case clause. (see [4]) > > > Thanks. > > [1] > https://github.com/wso2/carbon-appmgt/blob/master/features/appmgt/org.wso2.carbon.appmgt.publisher.feature/src/main/resources/publisher/themes/mobileapp/js/lib/handlebars/custom.handlebars.helpers.js > [2] > https://github.com/wso2/carbon-appmgt/blob/master/features/appmgt/org.wso2.carbon.appmgt.publisher.feature/src/main/resources/publisher/themes/mobileapp/js/lib/handlebars/custom.handlebars.helpers.js#L92 > [3] > https://github.com/wso2/carbon-appmgt/blob/master/features/appmgt/org.wso2.carbon.appmgt.publisher.feature/src/main/resources/publisher/themes/mobileapp/js/lib/handlebars/custom.handlebars.helpers.js#L143 > [4] > https://github.com/wso2/carbon-appmgt/blob/master/features/appmgt/org.wso2.carbon.appmgt.publisher.feature/src/main/resources/publisher/themes/mobileapp/js/lib/handlebars/custom.handlebars.helpers.js#L250 > > -- > Sajith Ariyarathna > Software Engineer; WSO2, Inc.; http://wso2.com/ > mobile: +94 77 6602284, +94 71 3951048 > -- With regards, *Manu*ranga Perera. phone : 071 7 70 20 50 mail : [email protected]
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
