Oops. Modified archives by accident.

This commit is contained in:
Barney 2014-11-07 10:26:00 +00:00
parent 44f6a9a64d
commit 1053b70d3e
2 changed files with 10 additions and 10 deletions

View file

@ -64,16 +64,16 @@
<hr>
<h3 id="usage">Usage</h3>
<pre><code class="lang-javascript">//define a getter-setter with initial value `John`
var firstName = m.prop(&quot;John&quot;);
var name = m.prop(&quot;John&quot;);
//read the value
var a = firstName(); //a == &quot;John&quot;
var a = name(); //a == &quot;John&quot;
//set the value to `Mary`
firstName(&quot;Mary&quot;); //Mary
name(&quot;Mary&quot;); //Mary
//read the value
var b = firstName(); //b == &quot;Mary&quot;</code></pre>
var b = name(); //b == &quot;Mary&quot;</code></pre>
<p>It can be used in conjunction with <a href="mithril.withattr.html"><code>m.withAttr</code></a> to implement data binding in the view-to-model direction and to provide uniform data access for model entity properties.</p>
<pre><code class="lang-javascript">//a contrived example of bi-directional data binding
var user = {
@ -137,4 +137,4 @@ where:
</footer>
<script src="lib/prism/prism.js"></script>
</body>
</html>
</html>