Converting an Angular app to TypeScript – part 2


In the previous article, I explained how to configure the build process and convert an Angular 1 controller to TypeScript. This article will continue building from where we left, and explain how to convert a service and a directive.


Converting an Angular app to TypeScript – part 1



In this post, I will try to set the basics on how to convert an Angular 1 application to TypeScript. Converting applications to TypeScript/ES6 is a first step towards migrating applications to Angular 2.

I build all my front-end apps using TypeScript, as I think it has a high added-value, and makes my life way easier. I actually know TypeScript better than native JavaScript.

This post uses my personal opinions and patterns (if I may use that word). I hope you enjoy reading it; feel free to ask me any question you might have.

As I am focusing on converting an app and not building an app from scratch, I will use John Papa‘s HotTowel generator as the basis for this application. I will therefore keep the spirit and structure of the application, the focus being to move the app to TypeScript.

The interest of this generator is that it is well structured and already comprises a well-established build process.

Code for the completed tutorial can be found on GitHub.


If you are here, I guess you are familiar with Angular. I will assume that you know what TypeScript is, but not much more than that. I will also take it that you know what yeoman is and how it works, as well as npm. Finally, some experience with build processes and gulp is advised.