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

Template has no data in a RouteControllers event handler #2

Open
manuel-schoebel opened this issue Oct 17, 2014 · 0 comments
Open

Template has no data in a RouteControllers event handler #2

manuel-schoebel opened this issue Oct 17, 2014 · 0 comments

Comments

@manuel-schoebel
Copy link

[Moved from https://github.com/iron-meteor/iron-router/issues/911]

For example

SomeController = RouteController.extend({
    template: 'myTemplate',
    data: function () { return SomeCollection.findOne(); },
    waitOn: function() { ... }
});

SomeController.events({
    'submit #my-form': function(evt, tpl){
        // this.data() works, tpl.data is undefined
        console.log(this.data(), tpl.data);
    }
});

Template.myTemplate.events({
    'submit #my-form': function(evt, tpl){
        // tpl.data is correct
        console.log(tpl.data);
    }
})

Maybe this is a bug, maybe intended?

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

No branches or pull requests

1 participant