I am using Meteor and Angular, and am having a hard time making my admin-specific code function properly. Locally, it works great, but once I use meteor build
and put it up on the server, my code doesn't function, but I don't see any errors either. Specifically, inside my /imports/components/storyAdmin.js
file, I have the following method:
this.isAdministrator = Meteor.call('users.isAdmin', Meteor.userId(), function(error, result) {
if (result) {
_that.isAdministrator = result;
_that.scope.$digest();
}
});
The problem is, it doesn't seem to run, and I can't really debug on the server since the code is all minified and uglified (I think that's the word).
Am I going about this the wrong way? I Googled a lot about this and haven't found a good way to do it yet, or how to fix the issue I'm having.
error
variable in your callback. Just doif(error)console.error(error);
Yes put the code in a tracker.autorun. – user3636214