I'm trying to do the Angular2/Meteor tutorial using my own type 'class' instead of 'party' and I'm getting errors on this line of code
classes.forEach((class: Class) => Classes.insert(class));
Here's the whole file:
import { Classes } from '../../../both/collections/classes.collection';
import { Class } from '../../../both/models/class.model';
export function loadClasses() {
if (Classes.find().cursor.count() === 0) {
const classes: Class[] = [{
name: 'Class1',
teacher: 'Dumbledore',
location: 'room 101'
}, {
name: 'Class2',
teacher: 'Hagrid',
location: 'Online'
}, {
name: 'Class3',
teacher: 'Harry Potter',
location: 'room 124'
}];
classes.forEach((class: Class) => Classes.insert(class));
}
}
Here is the error code among others that say the same thing for the most part.
server/imports/fixtures/classes.ts (20, 54): Argument of type 'typeof (Anonymous class)' is not assignable to parameter of type 'Class'.
Not sure if it is just being read wrong and I need to reset something. I have combed through my code multiple times and can't find any syntax/spelling errors. I tried 'meteor reset' just in case but no luck with that.