0

I am learning ember.js with a tutorial that is built in to their documentation. Having installed it successfully, I followed the steps and created a new application with ember new ember-quickstart, generated a template and defined a route. However, the data that I've included in the route model is not being rendered (there appears to be a parsing error due to an unexpected token default), but I have no idea what it might be referring to. I have pasted the code exactly as it appears. Any suggestions as to what might be causing the error?

SyntaxError: ember-quickstart/routes/scientists.js: Unexpected token (3:2)  

enter image description here

routes/scientists.js

import Ember from 'ember';

  default Ember.Route.extend({
  model(){
    return['Marie Curie', 'Albert Einstein', 'Andrei Sakharov']
  }
});

templates/scientists.hbs

<h2>List of Scientists</h2>

<ul>
  {{#each model as |scientist|}}
  <li>{{scientist}}</li>
  {{/each}}
</ul>

templates/application.hbs

<h2 id="title">Welcome To Ember</h2>

{{outlet}}

app/router.js

import Ember from 'ember';
import config from './config/environment';

const Router = Ember.Router.extend({
  location: config.locationType,
  rootURL: config.rootURL
});

Router.map(function() {
  this.route('scientists');
});

export default Router;

1 Answer 1

1
default Ember.Route.extend({

should be:

export default Ember.Route.extend({
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.