Function
aliasMethod (methodName) public deprecated
| Module: | @ember/object |
|---|
Defined in packages/@ember/-internals/metal/lib/mixin.ts:788
import { aliasMethod } from '@ember/object'; - methodName
- String
- name of the method to alias
Makes a method available via an additional name.
app/utils/person.jsimport 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/3.25/functions/@ember%2Fobject/aliasMethod