TypeScript Tutorial for Angular 7/8 Devs
Receive new TypeScript tutorials.
In this tutorial, we'll learn about TypeScript. The language of Angular.
Angular is written in TypeScript and officially recommended to be used with TypeScript, so you’ll need to have some knowledge of TypeScript, particularly the object oriented concepts such as classes and decorators which are both frequently used in Angular.
What is TypeScript?
TypeScript provides powerful OOP (Object Oriented Programming) features like:
- interfaces and classes,
- a declarative style,
- static typing and modules.
TypeScript is supported by two big companies in the software world, Microsoft, obviously because it's the creator but also by Google as it was used to develop Angular from v2 up to Angular 8 (The current version). It's also the official and recommended language to build Angular apps.
You can install the TypeScript compiler using npm and then you can call it by running the
tsc source-file.ts command from you terminal. This will generate a
source-file.js file with the same name.
You can control many aspects of the compilation process using a
tsconfig.json configuration file. For example, we can specify the module system to compile to and where to output the compiled file(s).
For large projects, you need to use advanced tools or task runners like Gulp and Grunt or code bundlers like Webpack.
You can use grunt-typescript and gulp-typescript plugins for integrating TypeScript with Gulp and Grunt which will allow you to pass the compiler options from your task runners. For Webpack, you can use the loader to work with TypeScript.
Type definitions are files that end with the
To install them you need to use Typings. It has its own configuration file, which is called
typings.json, where you need to specify paths for type definitions.
Note: We also publish our tutorials on Medium and DEV.to. If you prefer reading in these platforms, you can follow us there to get our newest articles.
You can reach the author via Twitter:Follow @ahmedbouchefra
About the author
Get our Learn Angular 8 in 15 Easy Steps ebook in pdf, epub and mobi formats, plus a new Angular 8 tutorial every 3 days.
Angular 9/8 Topics
Read our other tutorials
- Angular Tutorial
- Laravel 6 Tutorial
- React Tutorial
- React Hooks Tutorial
- React Native Tutorial
- Webpack Tutorial
- PHP Tutorial
- Django Tutorial
- Java Spring Tutorial
- Rails 6 Tutorial
- Ionic 4 Tutorial
- TypeScript Tutorial
- Bootstrap 4 Tutorial
- Electron Tutorial
- Cordova Tutorial
- HTML Tutorial
- GraphQL Tutorial
- CSS Grid Layout Tutorial
- PWA Tutorial