Posted On: Feb 22, 2018
The “id” property on a model is automatically assigned based on the “id” set in the model’s attributes hash.
Ideally, this is the ID that you receive from the rest API for the resource that you are querying. On the other hand, “cid” is an ID temporarily assigned to each model and is useful until an actual ID is determined for the object. For example, a model pushed to a collection that has not yet been persisted can be addressed using “cid”, until it is saved in the database and an actual ID is generated for it.
Never Miss an Articles from us.
Backbone.js is a client-side (Model, View, Controller) MVC-based JavaScript framework.It purely is written in Javascrip..
Backbone’s Js only hard dependency is Underscore.js ( >= 1.8.3). For RESTful persistence and DOM manipulation with..
The Backbone.js router is used to change the URL fragment or hashes of an application to create bookmarkable and shareab..