Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port to MVC framework #52

Open
garrett opened this issue Sep 29, 2011 · 0 comments
Open

port to MVC framework #52

garrett opened this issue Sep 29, 2011 · 0 comments
Labels

Comments

@garrett
Copy link
Collaborator

garrett commented Sep 29, 2011

While I like spine.js, I think there's a larger community around backbone... my concern with the underscore library is valid (name clashing with _() in Studio, for instance), but I figured out a workaround today, so I think we should use it (backbone).

Basically, we'd need to load it at the beginning of the scripts, like so:

<script src="underscore.js"></script>
<script src="backbone.js"></script>
<script>
  _.noConflict();
</script>

That script block can be replaced with a file only containing that one line. If we'd like to actually use underscore outside of backbone, we can alias it to something else, like so:

window.underscore = _.noConflict();

or

window.U = _.noConflict();

Then, we'd be able to use underscore (if we wanted), like so: U([1,2,3]).map(function(){}) or U.map([1,2,3], function(){});

Still, I prefer sugar.js to underscore. (:

Also, underscore's functions are available within backbone's collections:
http://documentcloud.github.com/backbone/#Collection-Underscore-Methods

I therefore think we should consider backbone for Cardboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant