Skip to content

{{# let }} scoped helper docs & mention that addConverter can take an object as name

Choose a tag to compare

@cherifGsoul cherifGsoul released this 17 Jan 19:20
· 120 commits to master since this release
  • Update the docs to explain how to use let helper:
    {{# let VARIABLE_NAME=VALUE [,HASHES] }} FN {{/ let}}

  • Mention that addConverter accepts a name as object to add multiple converters at once:

stache.addConverter({
	"numberToHex": {
		get: function(val) {
				return canReflect.getValue(val).toString(16);
		},
		set: function(val, valCompute) {
			return canReflect.setValue(valCompute, parseInt("0x" + val));
		}
	},
	"capitalize": {
		get: function(val){
			return canReflect.getValue(val).toString().toUpperCase();
		},
		set: function(val, valCompute) {
			return canReflect.setValue(valCompute, val.toLowerCase());
		}
	}
});

#645 and #633