Can't access Ember's class variable
问题 How to properly pass a variable to an Ember's class? Controller: import Controller from '@ember/controller'; import Object from '@ember/object'; function totalVotes(company) { return company.upvotes + company.downvotes; } function calcPercent(company) { return (company.upvotes * 100 / (company.upvotes + company.downvotes)).toFixed(2); } function percentComparator(a, b) { return calcPercent(b) - calcPercent(a); } var Company = Object.extend({ score: function() { return (this.get('upvotes') *