Putting some Backbone in your app

Since Backbone uses jQuery under the hood to work with the DOM, we can reuse much of the code from our jQuery application. We'll be using the same ArcGIS JavaScript API modules to interact with the map services. We'll only change how the drop-down options are rendered and how the change events on those dropdowns are handled. So, let's start by making a copy of our jQuery application and naming the folder Backbone.

Next, we'll need to add references to the Backbone and Underscore libraries in our dojoConfig, so that they are available through AMD. We'll load them from a CDN source for this application, although you're free to download them into folders for your own applications:

dojoConfig = { async: true, packages: ...

Get Mastering ArcGIS Server Development with JavaScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.