TypeScript & AngularJS TodoMVC Example
The TypeScript website is a great resource for getting started.
Here are some links you may find helpful:
Articles and guides from the community:
Get help from other TypeScript users:
If you have other helpful links to share, or find any of the links above no longer work, please let us know.
It's attractive to people with a background in strongly typed languages, who are willing to type in more code-- classes and type annotations-- receiving the benefit of type checking on compile time. IntelliSense works better, as well.
Several free and commercial editors work very well with TypeScript.
- Visual Studio Code is a free, open source editor from Microsoft that runs on Windows, Mac, and several Linux distros. It has native support for TypeScript.
- Visual Studio 2017 is available in several editions, including the Community Edition that is free for students, open-source, and individual developers, as well as commercial editions for professional developers. All editions except Visual Studio for Mac have native support for TypeScript.
- The Sublime text editor can support TypeScript with an open source plug-in created by Microsoft.
- Several other editors are supported, as found on the GitHub wiki for the TypeScript project.
Many extensions for Visual Studio and Visual Studio Code are available to enhance your productivity with TypeScript.
It is useful to have type information for the libraries you use. DefinitelyTyped is a nice collection of annotations by Boris Yankov.
*.tsare source code files.
*.d.tsare ambient declarations for libraries.
*.jsare generated by the compiler, except in the
*.js.mapare source maps generated by the compiler, for better debugging experience.
_all.tsis a convention used to enumerate file references in the project for the benefit of the TypeScript compiler.
If the number of files grows, you could put an
_all.ts file into each folder, move all nested references to it and reference the nested
_all.ts from the parent
TodoCtrl.ts first, continue with
index.html, then the rest of it is easy.
It's definitely possible to convert the vanillajs todo app into TypeScript, but TypeScript's benefits are more obvious with a full blown framework and project structure.
A standalone TypeScript compiler is available on NPM.
To compile the TypeScript in this project:
# from examples/typescript-angular $ npm run compile
Or use Visual Studio with the TypeScript plugin.