I would use Meteor.user() in data iron-router, but this is undefined at start...
I'm trying with:
waitOn: function() {
return curretUserHandle;
},
data: function() {
// access to Meteor.user().username, give me undefined
[...]
var curretUserHandle = {
ready: function () {
return 'undefined' !== typeof Meteor.user();
}
};
but data function of route is always call before curretUserHandle.ready() return true
I know that i can add if(Meteor.user()) in data, but this option don't like.
Why data don't wait that Meteor.user() is ready?
Adding https://atmospherejs.com/meteorhacks/fast-render 'magically' solves this.
However, please read the note on necessary security measures: https://meteorhacks.com/fast-render/security-measures/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With