Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4828

How can I load any json from my page?

$
0
0

@GELight wrote:

Hi,

I try to load a json file with an ember adapter + model but my json call failes with an error.

This is my code within my findRecord method in my application adapter:
findRecord: function findRecord(store, type, id, snapshot) {
return new Ember.RSVP.Promise(function (resolve, reject) {

    Ember.$.getJSON('/ui-page/index.json').then(function (data) {
      resolve(data);
    }, function (jqXHR) {
      reject(jqXHR);
    });

My json call is ever rejected ...
I need a little simple example that I can see what I do wrong.

I hope you can help me.
Thanks,

Greetings, Mario

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4828

Trending Articles