I want to display to template all exists properties of object, but can’t retrieve it:
import { Device } from ‘@ionic-native/device/ngx’;
…
constructor(private device: Device,
…
ngOnInit() {
console.log( this.device ); //dislpay as expected: Device cordova, model, etc…
console.log( Object.getOwnPropertyNames(this.device) ); //but here Array(0)
console.log( Object.keys(this.device) ); // and here Array(0)
}
but this iterations like this, works:
let result: object = {};
for(let v in this.device) {
result[v] = this.device[v];
}
My question.
Why calls getOwnPropertyNames, keys return empty data?