Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Nesting Dependency Backbone.js Views with Require.js Backbone.js Leads to View Loaded as Object Instead of Function
- define([
- 'jQuery',
- 'Underscore',
- 'Backbone',
- ], function ($, _, Backbone) {
- var ChildView = Backbone.View.extend({
- initialize: function () {
- _.bindAll(this, 'render');
- this.render();
- },
- });
- return ChildView;
- });
- define([
- 'jQuery',
- 'Underscore',
- 'Backbone',
- 'src/views/child-view'
- ], function ($, _, Backbone, ChildView){
- var ParentView = Backbone.View.extend({
- initialize: function () {
- _.bindAll(this, 'render');
- this.render();
- },
- render: function () {
- child = new ChildView({});
- }
- });
- return ParentView;
- });
Add Comment
Please, Sign In to add comment