wowpatrick
wowpatrick

Reputation: 5180

Ember.js data is not getting loaded in ObjectController

I'm currently working on a pure client side app that ueses LocalStorage to persist data. I need to save some settings data and am runinng in into some truble with the data loading. The data is persisted corretly, but is note retrived properly. I guess I'm getting somting worng with the Embers's ObjectController.

JS Bin: http://emberjs.jsbin.com/pelol/1/edit

Why isn't the data being loaded into the placeholder of the input elements? Or should I do something completely different for data like a single settings set?

Upvotes: 0

Views: 292

Answers (1)

chopper
chopper

Reputation: 6709

Change your App.settingsRoute to:

App.SettingsRoute = Ember.Route.extend({
  model: function() {
    return this.store.find('settings', '1');
  }
});

You should also change your {{input}}s to:

<p>Name</p>
{{input type="text" placeholder="name" valueBiding="name" }} 
<p>Home base</p>
{{input type="text" placeholder="homeBase" valueBinding="homeBase" }} 

See this jsBin.

Upvotes: 2

Related Questions