I am trying to learn how to start project in Angular 2 as so far got to second issue: After following this article I separated .ts from .js:
app: 'temp' - in systemjs.config.js
"outDir": "temp" - in tsconfig.json
And of course I got to the issue, when If I'm creating files for template or style (in app folder),they are not visible because there are not in the same folder as .js files.
For example:
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
})
export class AppComponent { name = 'World'; }
I am receiving error: Unhandled Promise rejection: Failed to load app.component.html
And if I'm adding moduleId: module.id I get Unhandled Promise rejection: Failed to load http://localhost:3000/temp/app.component.html
I saw that it is possible to achieve if I add .replace
to module.id
, but this is not what I want (if possible, I'd wanted to not use moduleId
at all). If possible, I'd like to not use grunt
either (at this moment at least) (tried its copy
functionality but it does not catch updates while npm start
is running)
It seems super strange to me that by just wanting to separate .ts from compiled files gives so much trouble with anything that is not .ts files.
Is there a simple way to work with .html
(or .css/.scss
in case of style) in case if there are stored in different directories (not the same as where compiled .js are) ?