Skip to content

Ecmascript problem  #78

Open
Open
@mervynteo

Description

I used a global helper below. However after I changed to ES6 or 2015 format, it broke.

Original

Channels.helpers({
   oppParty: function (){ 
      if( this.originator === Meteor.userId() ) {
         return Meteor.users.findOne({ _id: this.recipient });
      } else {
         return Meteor.users.findOne({ _id: this.originator });
      }
   }
});

changed to

Channels.helpers({
   oppParty (){ return this.originator === Meteor.userId() ? this.recipient : this.originator; }
});

I tried various combination and installed, uninstalled ES6, nothing worked. Anyone has the same issue?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions