Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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 :

/// <binding />
var ts = require('gulp-typescript');
var gulp = require('gulp');
var clean = require('gulp-clean');

var destPath = './libs/';

// Delete the dist directory
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 = tsProject.src()
    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
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900