Function

aliasMethod (methodName) public

Module: @ember/object
import { aliasMethod } from '@ember/object';
methodName
String
name of the method to alias

Makes a method available via an additional name.

app/utils/person.js
import EmberObject, {
  aliasMethod
} from '@ember/object';

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

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

© 2020 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://api.emberjs.com/ember/2.18/functions/@ember%2Fobject/aliasMethod