AnsweredAssumed Answered

Undefined in this.model.attribute

Question asked by Hiren Darji on Aug 20, 2016
Latest reply on Aug 20, 2016 by Bhavin Patel

Hello All,

I am trying to get value of attributes from this.model, but giving me result undefined.

 

This is my code in record.js

({
  extendsFrom: 'RecordView',
  initialize: function (options)
  {
    this._super('initialize', [options]);
    console.log(this.model.attributes);
    //this gives me perfect object in console and shwoing all values when I expand it in console
    console.log(this.model.get('parent_id'));
    //try 1, showing result undefined
    console.log(this.model.attributes.parent_id);
    //try 2, also showing result undefined
  },
});

Outcomes