You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-10Lines changed: 16 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,16 @@
1
1
Special thanks to [Derick Bailey](http://lostechies.com/derickbailey) for creating predecessor to this plugin.
2
2
I've been able to reuse unit tests he created for his [Backbone.ModelBinding](https://github.com/derickbailey/backbone.modelbinding) plugin.
3
3
4
-
### Availability
5
-
You can download the zip/tarball as normal and include it with your other JS assets, but you can now alternatively link to it on [CDNJS](http://www.cdnjs.com/), the free to use, community maintained CDN.
6
-
7
-
To do this, just drop a reference to the minified version of the plugin into your document's `<head>` as follows, replacing the version number with whatever the latest one is:
Backbone is a great platform for writing client side applications but I've found that as views grow in complexity, synchronizing my models and views can be a pain.
14
7
I've spent the past few months trying to use existing view-model binding libraries that others were kind enough to create and share with the world.
15
8
Unfortunately in the majority of my backbone application I wasn't able to leverage the existing view-model binding libraries due to various limitations.
16
9
17
10
I created a new `Backbone.ModelBinder` class that I have leveraged in the majority of a large client side application.
18
-
The ModelBinder class helped me remove a lot of cluttered boilerplate code that existed to synchronize my models and views. Hopefully you'll find it useful too.
11
+
The ModelBinder class helped me remove a lot of cluttered boilerplate code that existed to synchronize my models and views.
12
+
As my application became more asynchronous, the ModelBinder saves me from a lot of pain by automatically displaying model attributes in the view as they are asynchronously loaded.
While the style above technically works just fine it can be more efficient - especially for larger client applications that are not frequently refreshed.
47
+
While the style above technically works just fine it can be more efficient by using the ModelBinder - especially for larger client applications that are not frequently refreshed.
53
48
54
49
If render is called multiple times, the previously created html elements are just thrown away.
55
50
Converting the model to json is also an unnecessary conversion.
@@ -64,6 +59,17 @@ The ModelBinder eliminates both of these inefficiencies.
64
59
65
60
<br>
66
61
I've posted some [examples](https://github.com/theironcook/Backbone.ModelBinder/wiki/Examples) of how to use the ModelBinder but I'd recommend reading the docs first.
62
+
The examples don't show best practices but just show how you can make things work with the ModelBinder.
63
+
64
+
<br>
65
+
### Availability
66
+
You can download the zip/tarball as normal and include it with your other JS assets, but you can now alternatively link to it on [CDNJS](http://www.cdnjs.com/), the free to use, community maintained CDN.
67
+
68
+
To do this, just drop a reference to the minified version of the plugin into your document's `<head>` as follows, replacing the version number with whatever the latest one is:
0 commit comments