Issue on the 'Todos List with Angular' tutorial


#1

Hello, I’m a MeteorJS/AngularJS newbie and I’m following the Meteor tutorial (https://www.meteor.com/tutorials/angular/collections) for the todos list application but there seem to be errors with the line: controller: ['$scope', TodosListCtrl] as well the one with the export default angular ... according to cmd the first/main error is at l.17 (imports/components/todosList/todosList.js:17:7: Unexpected token (17:7)) of the following code in todoList.js:

import angular from 'angular';
import angularMeteor from 'angular-meteor';
import { Tasks } from '../../api/tasks.js';
import template from './todosList.html';

class TodosListCtrl {
    constructor($scope) {
        $scope.viewModel(this);

        this.helpers({
            tasks() {
                return Tasks.find({});
            }
        })
}

export default angular.module('todosList', [
    angularMeteor
    ])
.component('todosList', {
    templateUrl: 'imports/components/todosList/todosList.html',
    controller: ['$scope', TodosListCtrl]
});

#2

Can anyone here help me ?


#3

Can you update your post to use proper source code formatting? That will make it easier for us to help troubleshoot. Surround your code in 3 back ticks, like:

```
Your code …
```


#4

Done ! There you go :).


#5

I don’t see anything wrong with your code, and it seems to line up exactly with the repo code for that step. Maybe try a meteor reset to put your project back into a fresh state, then see if that helps (usual warning: meteor reset will wipe your local Mongo DB).


#6

I got it to reset and then I updated Meteor and all the necessary packages and I got it to run and to move on.