Menu

Maslosoft Binder Logo Maslosoft Binder Documentation
Knockout JS tracker and binding handlers with coffee and sugar

Edit

Punches

Punches bindings

Punches is a knockut JS library bundled with this package. It provides natural syntax for binding handlers.

Does not work when using with binding

This should be escaped value: {{binder.model.txt1.text}}
This should have html value: {{{binder.model.txt1.text}}}
This should have title attribute value of {{binder.model.txt1.text}}

Relevant code used in examples:

<p data-bind="with: binder.model.txt1">
	<input data-bind="textInput: text"></input>
	<div>This should be escaped value: {­binder.model.txt1.text­}­}</div>
	<div>This should have html value: {­binder.model.txt1.text­}­}­}</div>
	<span rel="tooltip" title="{­binder.model.txt1.text­}­}" data-original-title="{­binder.model.txt1.text­}­}">This should have title attribute value of {­binder.model.txt1.text­}­}</span>
</p>

<script>
	window.onload = (function () {­
		var data1 = {­
			text: 'Val1'
		­};
		var data2 = {­
			text: 'Val2'
		­};
		var data3 = {­
			text: 'Val3'
		­};

		binder.model.txt1 = new Maslosoft.Koe.TextValue(data1);
		binder.model.txt2 = new Maslosoft.Koe.TextValue(data2);
		binder.model.txt3 = new Maslosoft.Koe.TextValue(data3);

		ko.applyBindings({­model: binder.model­}, document.getElementById('ko-binder'));
		jQuery('body').tooltip({­
			selector: '[rel~="tooltip"]'
		­});
	­});
</script>