mardi 27 juin 2017

Access to JSON data (Ember)

How can I access JSON data from this?

In app/component/temp.js:

import Ember from 'ember';
let formData = {
    "Name": "David",
    "Phone": "123456789"
}

export default Ember.Component.extend({
    temp: formData;    
});

I tried to write console.log(temp); to see what I get, but I don't see what I want to see. How can I get name or phone? what command should I write to see? Maybe .get?




Aucun commentaire:

Enregistrer un commentaire