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
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev