Is there a way to export a module using systemjs in TypeScript? I encountered the error:
TS1148 cannot compile modules unless the '--module' flag is provided
.
Here's my code; animal.ts
export class Animal {
color: string;
age: number;
constructor(color: string, age:number) {
this.color = color;
this.age = age;
}
add(animal: Animal) {
return new Animal(this.color + animal.color, this.age + animal.age);
}
}
dog.ts
import {Animal} from './animal';
var animal1 = new Animal("red", 1);
var animal2 = new Animal("yellow", 2);
var animal3 = animal1.add(animal2);
console.log('Combining Two Animals' + animal3);