diff --git a/chapters/05-exercise-2.md b/chapters/05-exercise-2.md index e167c976..d61b3027 100644 --- a/chapters/05-exercise-2.md +++ b/chapters/05-exercise-2.md @@ -558,14 +558,14 @@ app.post( '/api/books', function( request, response ) { author: request.body.author, releaseDate: request.body.releaseDate }); - + return book.save( function( err ) { if( !err ) { console.log( 'created' ); return response.send( book ); - } else { - console.log( err ); - } + } else { + console.log( err ); + } }); }); ``` @@ -649,10 +649,10 @@ app.put( '/api/books/:id', function( request, response ) { return book.save( function( err ) { if( !err ) { console.log( 'book updated' ); - return response.send( book ); - } else { - console.log( err ); - } + return response.send( book ); + } else { + console.log( err ); + } }); }); }); @@ -826,9 +826,9 @@ url HTTP Method Operation To have our application retrieve the Book models from the server on page load, we need to update the LibraryView. The Backbone documentation recommends inserting all models when the page is generated on the server side, rather than fetching them from the client side once the page is loaded. Since this chapter is trying to give you a more complete picture of how to communicate with a server, we will go ahead and ignore that recommendation. Go to the LibraryView declaration and update the initialize function as follows: ```javascript -initialize: function() { - this.collection = new app.Library(); - this.collection.fetch({reset: true}); // NEW +initialize: function() { // UPDATED + this.collection = new app.Library(); // UPDATED + this.collection.fetch({reset: true}); // NEW this.render(); this.listenTo( this.collection, 'add', this.renderBook ); @@ -844,7 +844,7 @@ Now that we are populating our Library from the database using `this.collection. var app = app || {}; $(function() { - new app.LibraryView(); + new app.LibraryView(); // UPDATED }); ``` diff --git a/chapters/10-pagination.md b/chapters/10-pagination.md index eaf2266e..8142adc5 100644 --- a/chapters/10-pagination.md +++ b/chapters/10-pagination.md @@ -20,7 +20,7 @@ On this topic, we're going to go through a set of pagination components I (and a ### Backbone.Paginator **Note:** As of Backbone.Paginator [2.0](https://github.com/backbone-paginator/backbone.paginator/releases), the API to -the project has changed and includes updated which break backwards compatibility. The below section refers to Backbone.Paginator +the project has changed and includes updates which break backwards compatibility. The below section refers to Backbone.Paginator 1.0 which can still be downloaded [here](https://github.com/backbone-paginator/backbone.paginator/releases/tag/v1.0.0). When working with data on the client-side, the three types of pagination we are most likely to run into are: @@ -532,7 +532,7 @@ Note: Both the clientPager and requestPager ```bootstrap``` function will accept ### Styling -You're of course free to customize the overall look and feel of the paginators as much as you wish. By default, all sample applications make use of the [Twitter Bootstrap](http://twitter.github.com/bootstrap) for styling links, buttons and drop-downs. +You're of course free to customize the overall look and feel of the paginators as much as you wish. By default, all sample applications make use of [Twitter Bootstrap](http://twitter.github.com/bootstrap) for styling links, buttons and drop-downs. CSS classes are available to style record counts, filters, sorting and more: diff --git a/chapters/11-bbb.md b/chapters/11-bbb.md index 27977071..7c9e568a 100644 --- a/chapters/11-bbb.md +++ b/chapters/11-bbb.md @@ -31,7 +31,7 @@ Notes on build tool steps: To get started we're going to install Grunt-BBB, which will include Backbone Boilerplate and any third-party dependencies it might need such as the Grunt build tool. -We can install Grunt-bBB via NPM by running: +We can install Grunt-BBB via NPM by running: ```shell npm install -g bbb