Build your first project with angularjs and typescript in Visual Studio

1. Create new ASP.Net Web Application, remember to select the empty template

2. Open Command Line window and go to your project folder


npm init


npm install typescript --save-dev


npm install @types/angular --save


npm install angular

7. Create a tsconfig.json like this:

        “compileOnSave”: true,
        “compilerOptions”: {
                  “noImplicitAny”: false,
                  “noEmitOnError”: true,
                  “removeComments”: true,
                  “sourceMap”: true,
                  “target”: “es5”
         “include”: [

8. Create a file “Index.html” in your root folder

<!DOCTYPE html>

         < script src=”/node_modules/angular/angular.js”></script>
         < script src=”scripts/script.js”></script>



9. Create a folder “Scripts” and add a new ts file “script.ts” in it

var module = angular.module(“myAwesomeApp”, []);

module.component(“myangularjs”, {
         template: “This is my template”,
         controller: function myAngularJSController() { },
         controllerAs: “$ctrl”

angular.element(document).ready(function () {
         angular.bootstrap(document, [“myAwesomeApp”]);

Here is the completed structure, please press F5 to see what happen: