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

How can I use namespaces? #201

Closed
abrkn opened this issue Sep 29, 2012 · 3 comments
Closed

How can I use namespaces? #201

abrkn opened this issue Sep 29, 2012 · 3 comments

Comments

@abrkn
Copy link
Contributor

@abrkn abrkn commented Sep 29, 2012

This crashes:

  <script>
    var App = {};
    $(function() {
      App.Detail = Backbone.RelationalModel.extend({});  
      App.Master = Backbone.RelationalModel.extend({
          relations: [{
              type: Backbone.HasMany,
              key: 'details',
              relatedModel: 'App.Detail',
              reverseRelation: {
                  key: 'master'
              }
          }]
      });

      var master = new App.Master;
      var detail = new App.Detail;
      master.get('details').push(detail);
    });
  </script>

http://jsbin.com/ejokay/2/edit

@abrkn
Copy link
Contributor Author

@abrkn abrkn commented Sep 29, 2012

Seems to be an issue with using underscore.js 1.4.0 (1.3.3 works fine)

@thomporter
Copy link

@thomporter thomporter commented Oct 2, 2012

I'm having the same problem, but 1.3.3 didn't fix it for me (I didn't check if I needed to downgrade backbone as well.)

I'm also using another level in my namespace:

App = {
  Models: {},
  Collections: {},
  Controllers: {}
}
@DouweM
Copy link
Collaborator

@DouweM DouweM commented Dec 20, 2012

Seems to work fine with latest Underscore, Backbone and Backbone-relational.

@DouweM DouweM closed this Dec 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.