I am currently developing an app using angularjs and typescript, but I've encountered a persistent error that has me stumped.
Below is the snippet of my code:
export var NgApp = new application.Startup();
///<reference path="../../../../../typings/tsd.d.ts"/>
import {NgApp} from "../../bootstrap";
module views.components.home {
export class HomeComponent {
public constructor() {
}
public static factory():Function[] {
return [
() => new HomeComponent()
]
}
}
}
NgApp.registerComponents(views.components.home,() => this.app.controller);
Next, here is the GULP task I am running:
let tsResult = gulp.src('src/**/*.ts').pipe(ts({
module: 'commonjs',
sourceMap: true
}));
let taskTs = tsResult.js.pipe(gulp.dest('built/'));
The specific error message I'm encountering is as follows: Uncaught ReferenceError: exports is not defined.
My query is: How can I incorporate imports akin to es6 syntax in typescript? Is there something crucial that I may have overlooked?