Ember.aliasMethod()

aliasMethod (methodName) public

Defined in packages/ember-metal/lib/mixin.js:673

Makes a method available via an additional name.

App.Person = Ember.Object.extend({
  name: function() {
    return 'Tomhuda Katzdale';
  },
  moniker: Ember.aliasMethod('name')
});

let goodGuy = App.Person.create();

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

Parameters:

methodName String
name of the method to alias
doc_EmberJs
2016-11-30 16:51:06
Comments
Leave a Comment

Please login to continue.