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

Comments

Projects
None yet
3 participants
@abrkn
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@abrkn

abrkn Sep 29, 2012

Contributor

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

Contributor

abrkn commented Sep 29, 2012

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

@thomporter

This comment has been minimized.

Show comment
Hide comment
@thomporter

thomporter 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: {}
}

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

This comment has been minimized.

Show comment
Hide comment
@DouweM

DouweM Dec 20, 2012

Collaborator

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

Collaborator

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