Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Writing AngularJS apps in TypeScript and ES6

Writing AngularJS apps in TypeScript and ES6

ng-sydney presentation on my experience converting angular 1.x apps to TypeScript and ES6, accompanied with the source code available at https://github.com/haroldrv/ng-admin-ui

Avatar for Harold Rodriguez

Harold Rodriguez

August 04, 2016
Tweet

Other Decks in Programming

Transcript

  1. About me Harold Rodriguez JavaScript and .NET developer Blog: http://haroldrv.com

    Twitter: @haroldrv1 Github: https://github.com/haroldrv
  2. Agenda 1. Why would you write AngularJS apps in ES6

    and TypeScript? 2. Converting your app to TypeScript 3. Adding types to your application 4. ES6 namespaces vs modules 5. Module loaders
  3. 1. AngularJS? With TS and ES6, why? • TypeScript: ◦

    Allows you to write more robust and scalable apps ◦ Provides types, classes and interfaces ◦ Transpiles to ES5 • ES6 ◦ JavaScript of today (ES5 is so yesterday) ◦ Modules, arrow functions, etc. • Easier to upgrade to Angular2!
  4. 2. Converting your app to TypeScript • Install typescript globally

    npm install -g typescript • Install typings globally: npm install -g typings • Install type definition files: typings install --global --save dt~angular • Install task runner to transpile your TS into JS npm install --save-dev grunt-ts • Rename your files from .js to .ts