mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-30 03:00:06 -04:00
adding a section to the Backbone FAQ on extending...
This commit is contained in:
20
index.html
20
index.html
@@ -363,6 +363,7 @@
|
||||
<li>– <a href="#FAQ-tim-toady">More Than One Way To Do It</a></li>
|
||||
<li>– <a href="#FAQ-nested">Nested Models & Collections</a></li>
|
||||
<li>– <a href="#FAQ-bootstrap">Loading Bootstrapped Models</a></li>
|
||||
<li>– <a href="#FAQ-extending">Extending Backbone</a></li>
|
||||
<li>– <a href="#FAQ-mvc">Traditional MVC</a></li>
|
||||
<li>– <a href="#FAQ-this">Binding "this"</a></li>
|
||||
<li>– <a href="#FAQ-rails">Working with Rails</a></li>
|
||||
@@ -2890,6 +2891,25 @@ Inbox.messages.fetch();
|
||||
</script>
|
||||
</pre>
|
||||
|
||||
<p id="FAQ-extending">
|
||||
<b class="header">Extending Backbone</b>
|
||||
<br />
|
||||
Many JavaScript libraries are meant to be insular and self-enclosed,
|
||||
where you interact with them by calling their public API, but never peek
|
||||
inside at the guts. Backbone.js is <i>not</i> that kind of library.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Because it serves as a foundation for your application, you're meant to
|
||||
extend and enhance it in the ways you see fit — the entire source
|
||||
code is <a href="docs/backbone.html">annotated</a> to make this easier
|
||||
for you. You'll find that there's very little there apart from core
|
||||
functions, and most of those can be overriden or augmented should you find
|
||||
the need. If you catch yourself adding methods to <tt>Backbone.Model.prototype</tt>,
|
||||
or creating your own base subclass, don't worry — that's how things are
|
||||
supposed to work.
|
||||
</p>
|
||||
|
||||
<p id="FAQ-mvc">
|
||||
<b class="header">How does Backbone relate to "traditional" MVC?</b>
|
||||
<br />
|
||||
|
||||
Reference in New Issue
Block a user