mardi 9 mai 2017

Ember route model() error and model() data is not displayed in related hbs template

code: http://ift.tt/2ptaRU2

you can play here http://ift.tt/2qPujz0

export default Ember.Route.extend({
  model: function() {
    var companies = [{
      "name" : "Google",
      "headquarters": "Mountain View, California, United States of America",
      "revenue":"59825000000"
    },{
      "name" : "Facebook",
      "headquarters":"Menlo Park, California, United States of America",
      "revenue":"7870000000"
    },{
      "name" : "twitter",
      "revenue": "664000000",
      "headquarters":"San Francisco, California, United States of America"
    }];
    return companies;
  };
});

getting the following error

ember-twiddle-f01fea9….js:2 SyntaxError: routes/my-route.js: unknown: Unexpected token (17:3)
    }];
    return companies;
  };
});
    at t.default.raise (vendor-9da9463….js:75)
    at t.s.unexpected (vendor-9da9463….js:76)
    at t.s.expect (vendor-9da9463….js:76)
    at t.s.parseObj (vendor-9da9463….js:75)
    at t.s.parseExprAtom (vendor-9da9463….js:75)
    at t.parseExprAtom (vendor-9da9463….js:77)
    at t.s.parseExprSubscripts (vendor-9da9463….js:75)
    at t.s.parseMaybeUnary (vendor-9da9463….js:75)
    at t.s.parseExprOps (vendor-9da9463….js:75)
    at t.s.parseMaybeConditional (vendor-9da9463….js:75)

plus data from route.model() is not displayed in associated hbs template enter image description here

what am I doing wrong?




Aucun commentaire:

Enregistrer un commentaire