Giter VIP home page Giter VIP logo

backbone-relationships's People

Contributors

samduvall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

backbone-relationships's Issues

Docs out of date?

Hey Sam,

I was trying out your library today and found the codec idea to be pretty great. Unfortunately when I set up a quick example, my codecs weren't affecting my model fields at all. After further inspection of the code it appeared that the format of the "fields" object in your examples is possibly out of date? Or maybe I somehow have an older version of your code. Correct me if I'm wrong but in your examples fields is an array that looks like this:

fields: [
  {name: 'exampleField', codec: Date}
]

But it should be this:

fields: {
  example: {type: Date}
}

After changing my format to the latter, my codecs started working.

On another note, when importing your library using require, it does not work. The issue is that the your index.js which is used as the entry point when the library is required, builds up the library in a way in which each piece (Relation.js, Model.js, has-one.js, etc) are not aware of eachother or some of their needed dependencies and the browser now throws an error that the HasOne object cannot be found. I fixed this by changing the using the fully built backbone-relationships.js file as my index.js and it now works as expected. Note: This issue shows up when you try to use npm's "Try it out" functionality on npmjs.com.

Hope this helps! Love the library now that I have it working.

Dock

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.