locked
TypeScript code is not converting into Native js code. RRS feed

  • Question

  • User-764499846 posted

    HI Team,

    I am facing problem with the Angular Application, i am very new to this Angular code, to setup the angular project to run with out lite server to compile the type script to js. 

    we have to set the entry point in tsconfig.json file as compileonSave : true. then when ever we run the application using F5 then it will compile the ts file changes to js file. But it is not happening my ts code is not appering in js files. when i run the application i didn't able to see those changes. when i verified on console then the js files are not updating. i did it in so many ways like clearing the browser data because of any cache problem and restarted the visual studio also nothing is working still js file contains the same old code. ts file changes are not appearing.

    please give some suggestions on this . is their any changes i have to do it. i want to run the Angular application with out using lite server.

    Thanks

    Siva

    Wednesday, January 9, 2019 1:01 AM

All replies

  • User-474980206 posted

    we would need to know the javascript build chain you are using, the version of typescript, the version of visual studio, any plugins, and the version of angular to help you. also asp.net core templates are different from classic templates, so this info is also required.

    Wednesday, January 9, 2019 6:48 PM
  • User-764499846 posted

    Visual Studio 2015 with update3, Traget Framework = 4.5

    TypeScript 2.1

    "dependencies": {
    "@angular/common": "~4.3.4",
    "@angular/compiler": "~4.3.4",
    "@angular/core": "~4.3.4",
    "@angular/forms": "~4.3.4",
    "@angular/http": "~4.3.4",
    "@angular/platform-browser": "~4.3.4",
    "@angular/platform-browser-dynamic": "~4.3.4",
    "@angular/router": "~4.3.4",
    "angular-in-memory-web-api": "~0.3.0",
    "systemjs": "0.19.40",
    "core-js": "^2.4.1",
    "rxjs": "5.0.1",
    "zone.js": "^0.8.4"
    },
    "devDependencies": {
    "concurrently": "^3.2.0",
    "lite-server": "^2.2.2",
    "typescript": "~2.1.0",
    "canonical-path": "0.0.2",
    "tslint": "^3.15.1",
    "lodash": "^4.16.4",
    "jasmine-core": "~2.4.1",
    "karma": "^1.3.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~4.0.14",
    "rimraf": "^2.5.4",
    "@types/node": "^6.0.46",
    "@types/jasmine": "2.5.36"
    }

    i am not using any other plugins

    Thursday, January 10, 2019 1:15 AM
  • User-474980206 posted
    Looks like you are using angular 4. You need to install a current version of node, and change where vs2015 looks for node (vs comes with an obsolete version). Then you install angular build tools. Then you use the ng tool to build. See

    https://angular.io/guide/visual-studio-2015

    What the instruction don’t make clear, is that f5 does not do an angular build, it’s just the setup to call the angular index.html page. In dev you would normally build with watch, so it recompile’s the JavaScript when saved by the ide.

    Note: if you edit the project file you can add a msbuild step (use a command shell step) to do the ng build on a standard vs compile.

    Thursday, January 10, 2019 1:42 AM