Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

13.3. Model

JavaScriptMVC’s model and its associated plug-ins provide lots of tools around organizing model data, such as validations, associations, lists, and more. But the core functionality is centered around service encapsulation, type conversion, and events.

13.3.1. Attributes and Observables

Of absolute importance to a model layer is the ability to get and set properties on the modeled data, and to listen for changes on a model instance. This is the Observer pattern, and it lies at the heart of the MVC approach—views listen to changes in the model.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial