npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

backbone-parentmodel

1.0.1 • Public • Published

backbone-parentmodel

Build Status

backbone-parentmodel provides a set of extensions to Backbone.Model for working with nested structures where logic is assigned to nested Models and Collections. The core functionality overrides clone, clear, toJSON, and parse methods to handle the nesting and provides a few additional utility methods.

Nested structures are defined as:

const MyModel = ParentModel.extend({
    childModels: {
        myModel: MyModelConstructor
    },
    childCollections: {
        myCollection: MyCollectionConstructor
    }
})

childModels and childCollections must either be an object mapping property names to their constructors, or they may be functions returning an object mapping.

Getting Started

This package is published to npm and can be installed with

npm install backbone-parentmodel

Documentation

See our docs folder for more detailed documentation.

Contributing

We encourage you to contribute to this project!

Please read our contributing guide for guidelines on:

  • how to ask further questions
  • how to report issues
  • how to request or implement new features

Maintainers

Please contact one of the project maintainers with any project issues or questions.

LICENSE

Apache 2

install

npm i backbone-parentmodel

Downloadsweekly downloads

0

version

1.0.1

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
Report a vulnerability