You could, if you wanted to, go much further. You could start using a whole host of TypeScripts functionality: modules / classes / arrow functions... the whole shebang. But my port is deliberately not that; I didn't want to scare your horses... I wanted you to see how easy it is to move from JS to TS. And I'm standing on the shoulders of that great giant John Papa for that purpose.
If you wanted an example of how you might go further in an Angular port to TypeScript then you could take a look at my previous post on the topic.
In fact there are only 2 differences in the end:
...had the filtering changed from this:
to this: ```ts return (r.config.settings && r.config.settings.nav) ? true : false;
Then simply follow the instructions for installing HotTowel-Angular and then drop this repo's app folder over the one just created when HotTowel-Angular was installed. If you're using Visual Studio then make sure that you include the new TS files into your project and give them the
You'll need the following NuGet packages for the relevant DefinitelyTyped Typings:
And you're good to go. If you're not using Visual Studio then you may need to add in some
<reference path="angular.d.ts" /> etc. statements to the TypeScript files as well.
If you're interested in the specific versions of the typings that I used then you can find them in the
packages.config of the repo.
To John Papa for creating HotTowel-Angular. Much love.
And my mum too... Just because.