Guest User

Untitled

a guest
Sep 18th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. Nesting Dependency Backbone.js Views with Require.js Backbone.js Leads to View Loaded as Object Instead of Function
  2. define([
  3. 'jQuery',
  4. 'Underscore',
  5. 'Backbone',
  6. ], function ($, _, Backbone) {
  7. var ChildView = Backbone.View.extend({
  8. initialize: function () {
  9. _.bindAll(this, 'render');
  10. this.render();
  11. },
  12. });
  13. return ChildView;
  14. });
  15.  
  16. define([
  17. 'jQuery',
  18. 'Underscore',
  19. 'Backbone',
  20. 'src/views/child-view'
  21. ], function ($, _, Backbone, ChildView){
  22. var ParentView = Backbone.View.extend({
  23.  
  24. initialize: function () {
  25. _.bindAll(this, 'render');
  26.  
  27. this.render();
  28. },
  29. render: function () {
  30. child = new ChildView({});
  31. }
  32. });
  33. return ParentView;
  34. });
Add Comment
Please, Sign In to add comment