Function
getProperties (obj, list) Object public
Module: | @ember/object |
---|
Defined in packages/ember-metal/lib/get_properties.js:6
import { getProperties } from '@ember/object';
- obj
- Object
- list
- String...|Array
- of keys to get
- returns
- Object
To get multiple properties at once, call getProperties
with an object followed by a list of strings or an array:
import { getProperties } from '@ember/object'; getProperties(record, 'firstName', 'lastName', 'zipCode'); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
is equivalent to:
import { getProperties } from '@ember/object'; getProperties(record, ['firstName', 'lastName', 'zipCode']); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
© 2020 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://api.emberjs.com/ember/2.18/functions/@ember%2Fobject/getProperties