Currently, I am in the process of learning how to implement routing in Angular2 by following a tutorial. The tutorial involves creating partial pages using .ts files along with companion .js files for each page. While my Atom editor, equipped with atom-typescript plugin, successfully compiles my app.ts file into app.js upon any changes made, it fails to compile the partial pages located in another directory.
For example, when the file is named homePage.ts, the console error reads "cannot find homePage.js". On the other hand, if the file is named homePage.js, the console throws an error stating "unexpected token @" at the line where @Component is used.
Despite having "compileOnSave": true in my tsconfig file placed in the project's root directory, the issue persists. I attempted to include "filesGlob" in the tsconfig as per the documentation, but that did not resolve the problem.
My current compilerOptions are set as follows:
"compilerOptions": {
"charset": "UTF-8",
"declaration": false,
"diagnostics": true,
"emitDecoratorMetadata": true,
"module": "commonjs",
"noImplicitAny": false,
"noLib": false,
"removeComments": true,
"sourceMap": true,
"target": "es5",
"version": true
},
Now, I am unsure whether both .ts and .js files are required for all components and how can I ensure they are compiled properly by atom-typescript. Alternatively, I would like to understand why the unexpected token @ error occurs.