Skip to content

sprin/backbone_ext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Backbone Extensions

Info:See github for the latest source.
Version: 0.1.0
License:MIT, see LICENSE file.

About

Just some extensions we have found useful for a Supervisory MVC structure:

Utility

  • Backbone.proxy

    Translate a concrete event into an abstract event, or simply pass the message up the MVC chain.

Controller

  • Backbone.Controller

    An alias for View, for semantic clarity.

Model

  • getModelName

    Get the model name from the urlRoot, assuming a URL naming convention of /api/<model_name>.

  • toDisplay

    Similar to toJSON, but formats moment.js objects with supplied date format.

Collection

  • toDisplay

    Map toDisplay on each model in the collection.

  • fetchAndAddOne

    Fetch a model object by id and add it to the collection.

  • addUnique

    Add only models not already in collection, rejecting models with duplicate ids.

About

Extensions for backbone.js Models, Collections, and Views

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published