Backbone.js Cookbook by Vadim Mirgorod

By Vadim Mirgorod

There is not any doubt that some of the best rendering strength of HTML5, thin-to-thick customer transition and relaxation type verbal exchange created a brand new period in net improvement, changing the superseded method in line with browser plugin applied sciences. Backbone.js permits builders to put in writing light-weight, modular, and scalable JavaScript applications.

Backbone.js Cookbook includes a sequence of recipes that supply functional, step by step suggestions to the issues which could happen in the course of frontend program improvement utilizing an MVC trend. you'll the way to construct spine purposes using the ability of well known spine extensions and integrating your app with various 3rd social gathering libraries. additionally, you will how to satisfy the necessities of the main hard tasks.

The first bankruptcy of the e-book introduces you to the MVC paradigm and teaches you the way to architect wealthy net functions working with easy techniques of Backbone.js. through the studying of this publication you are going to easy methods to clear up hard difficulties leveraging spine items reminiscent of versions, collections, perspectives, routers, and so on.

You how you can use varieties, layouts, templating engines, and different spine extensions, with a view to assist you to accomplish particular positive factors of your software. you'll know how to bind a version to a DOM point. you will discover how completely Backbone.js integrates with 3rd celebration libraries and frameworks similar to jQuery, Zepto, Underscore.js, Require.js, Mustache.js, Twitter Bootstrap, jQueryMobile, PhoneGap etc. This e-book will consultant you in tips to optimize and attempt your functions, create your individual spine extensions, and proportion them with the open resource community.

With assistance from Backbone.js Cookbook, you are going to study every little thing you must recognize to create remarkable wealthy web functions utilizing the JavaScript programming language.

Show description

Read Online or Download Backbone.js Cookbook PDF

Best javascript books

Building Single-page Web Apps with Meteor

Approximately This Book

Create an entire net weblog from frontend to backend that makes use of in basic terms JavaScript
Understand how net 2. zero is made by means of strong browser-based applications
Step-by-step educational that might convey you ways quick, complicated net purposes might be built
Who This publication Is For

If you're a net developer with uncomplicated wisdom of JavaScript and need to tackle net 2. zero, construct real-time purposes, or just are looking to write an entire software utilizing simply JavaScript and HTML/CSS, this can be the e-book for you.

This publication is predicated on Meteor 1. zero.

JavaScript (5th Edition) (The Web Technologies Series)

Now in its 5th version, JAVASCRIPT publications starting programmers via net software improvement utilizing the JavaScript programming language. As with past variations of this e-book, Don Gosselin introduces key internet authoring suggestions with a robust specialize in program. A real-world undertaking, just like what scholars may come upon in a qualified surroundings, is built all through each one bankruptcy.

JavaScript & jQuery: The Missing Manual, 2nd Edition

JavaScript allows you to supercharge your HTML with animation, interactivity, and visible effects-but many internet designers locate the language difficult to profit. This jargon-free consultant covers JavaScript fundamentals and exhibits you the way to save lots of effort and time with the jQuery library of prewritten JavaScript code. you will soon be construction websites that believe and act like laptop courses, with no need to do a lot programming.

Javascript Unlocked

Increase your code maintainability, functionality, and protection via functional professional insights and liberate the entire capability of JavaScriptAbout This BookImprove your JavaScript code for higher maintainability and performanceDiscover the best way to enforce scalable program structure with JavaScriptLearn to take advantage of JavaScript at the back of the browser, together with its command-line instruments, machine apps, and local cellular appsWho This ebook Is ForJavaScript Unlocked is for these JS builders who are looking to see simply how some distance they could push their favorite language via functional perception and methods.

Extra resources for Backbone.js Cookbook

Sample text

This can be helpful in some cases, for example, if a virtual attribute depends on other attributes. 1. Introduce a new virtual attribute by overriding getter for it. extend({ // Use mutators mutators: { // Introduce virtual attribute. lastName; } } } }); In the model object, we defined a new mutators attribute, which provides our model with a getter for the new virtual attribute named fullName. This attribute is not assumed to be stored in the model, because it contains values of existing attributes firstName and lastName.

Memento, which allows you to ignore some model attributes from being saved or restored. It is very useful if a model contains some technical properties, which is not intended to be used as part of the state. When extending a model in the initialize() method, pass the properties to be ignored in the ignore option. extend({ // Extend model instance with memento instance. // Ignore restoring of description attribute. Memento( this, {ignore: ["description"]} )); } }); Working with collections The Memento extension also allows to extend a collection with Memento functionality.

We want this attribute to be represented as a string to the user, so we are going to override getter and setter for it. The usage syntax stays the same as for a regular attribute. vip; // true 40 Chapter 2 Mutators aim to override setters or getters, but they do not modify attribute values itself. You can always get the original attributes by accessing the attributes property of a model. Handling mutators events You can bind callback to the mutators:set:* event. set({ fullName: 'Mister Y' }); See also ff Handling events of Backbone objects in Chapter 5, Events and Bindings Creating undo points to store/restore a model's state Sometimes, you may need to manage the states of a model in your application.

Download PDF sample

Rated 4.20 of 5 – based on 21 votes

About the Author

admin