Function

methodName
String
name of the method to alias

Makes a method available via an additional name.

app/utils/person.js
1
2
3
4
5
6
7
8
9
10
import EmberObject, {
  aliasMethod
} from '@ember/object';

export default EmberObject.extend({
  name() {
    return 'Tomhuda Katzdale';
  },
  moniker: aliasMethod('name')
});
1
2
3
4
let goodGuy = Person.create();

goodGuy.name();    // 'Tomhuda Katzdale'
goodGuy.moniker(); // 'Tomhuda Katzdale'