Hi everyone I am trying to learn angular2 and I'm using Visual Sutio 2015.
I made an angular2 project in a web application in visual studio. Everything was working well, I could make changes, create a new component typescript was compiling and in the browser was displayed the content of my template. I made that project on a computer that was not mine so I copy it on a usb key to be able to work on it on my computer. When I run the project it's still working, it stills displays the content, but when I create a new component or make changes on the existing one from typescript file, there is no changes in the javascript file neither in the browser... I don't know how but for a moment changes in typescript appeard also in javascript file, but still not in the browser, I closed the project and reopen it and now it's like I'm no making any changes at all, I don't know what to do.. I'm using gulp to compile the files :
gulp file :
var ts = require('gulp-typescript');
var gulp = require('gulp');
var clean = require('gulp-clean');
var destPath = './libs/';
gulp.task('clean', function () {
return gulp.src(destPath)
.pipe(clean());
});
gulp.task("scriptsNStyles", () => {
gulp.src([
'core-js/client/**',
'systemjs/dist/system.src.js',
'reflect-metadata/**',
'rxjs/**',
'zone.js/dist/**',
'@angular/**',
'jquery/dist/jquery.*js',
'bootstrap/dist/js/bootstrap.*js'
], {
cwd: "node_modules/**"
})
.pipe(gulp.dest("./libs"));
});
gulp.task("html",
function() {
gulp.src(["tsScripts/**/*.html"])
.pipe(gulp.dest('./Scripts'));
});
var tsProject = ts.createProject('tsScripts/tsconfig.json', {
typescript: require('typescript')
});
gulp.task('ts', function (done) {
var tsResult = gulp.src([
"tsScripts/**/*.ts"
])
.pipe(ts(tsProject), undefined, ts.reporter.fullReporter());
return tsResult.js.pipe(gulp.dest('./Scripts'));
});
gulp.task('watch', ['watch.ts']);
gulp.task('watch.ts', ['ts'], function () {
return gulp.watch('tsScripts/**/*.ts', ['ts']);
});
gulp.task('default', ['scriptsNStyles','html', 'watch']);
tsconfig :
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "commonjs",
"noEmitOnError": true,
"noImplicitAny": false,
"outDir": "../Scripts/AppClient",
"removeComments": false,
"sourceMap": true,
"target": "es5",
"moduleResolution": "node"
},
"exclude": [
"node_modules",
"typings/index",
"typings/index.d.ts"
]
}
What am I missing?
What I have tried:
I tried to reinstall npm and typescript, rebuild the project, close and reopen the project I have tried some solution give on stackoverflow like in put "compileOnSave : true" in the tsconfig, nothing is making any difference