akre54 / backbone.attributes Goto Github PK
View Code? Open in Web Editor NEWGive any object Backbone getters and setters
License: MIT License
Give any object Backbone getters and setters
License: MIT License
It’d be helpful if you would include docs on how to shim or otherwise add Attributes
to Backbone
with RequireJS, as I’m requiring Backbone where I need it, and don’t depend on it being available on the window
. I’m a bit rusty on the configuration, which makes the bar a bit too high to quickly try out what seems like a promising utility. :)
I came across some unexpected behavior. You might already know that it behaves this way, but I took your example to create window.playlist
.
And then:
playlist.attributes;
// => undefined
playlist.getAttribute('currentTrack');
// => 0
playlist.attributes;
// returns the defaults
The expected behavior is that attributes would always exist. I only took a quick glance at the code, but it seems like attributes is only created once one of the wrapped methods is called, so that would explain the behavior.
If this isn't something you're interested in trying to resolve, it might at least be something worth mentioning in the docs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.