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

Update module initialize to include moduleName and app #898

Closed

Conversation

jasonLaster
Copy link
Member

This is helpful when using an object literal pattern for modules and you want a reference back to app. Should be backward compatable.

var moduleClass = Backbone.Marionette.Module.extend({
    startWithParent: false,

    controller: {
        index: function() {}
    },

    initialize: function(options, moduleName, app) {
        this.app = app;
    },

    onStart: function() {},

    onStop: function() {},
});

@jamesplease
Copy link
Member

👍

Though, damn, I really wish I had done this when I first wrote this so that the signature of the constructor and the initialize function could match.

@jasonLaster
Copy link
Member Author

@jmeas yup. Fully support consistent signatures.

@Anachron
Copy link

Anachron commented Feb 5, 2014

Awww, this is awesome! Thanks a lot.

@samccone
Copy link
Member

samccone commented Feb 7, 2014

merged into dev and into master thanks!

@samccone samccone closed this Feb 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants