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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.