Tag Archives: typescript

Creating an Angular application with @angular/cli

@angular/cli is a package that allows you to create/run/test/build an Angular application.

You can install it globally

npm i -g @angular/cli

If you run the cli commands in a project that also has the cli installed it will use the project cli version instead.
Continue reading

Advertisements

Bot for Slack built with TypeScript and node – @genos

You can find the bot project on my Github – slack-genos.

genos-bot-slack

There is a node package called slack that extracts all the Slack API and create functions for each.

npm i -S slack

They don’t provide TypeScript definition files, but we can create on own file under /typings folder.

With that I created a structure to run the bot.
Continue reading

Using TypeScript to map database schema and models

Imagine a large scale application, with a big database full of tables and columns. Now imagine that you will have to remove a column from one of the tables, how would you guarantee that removing that column will not cause issues on your application?

In C# using Code First or Entity models that would be easy, your application would break when trying to reference something that no longer exist. In JavaScript you don’t get to know where things are being referenced, but if you use TypeScript there is a way to keep track of it.

Normally in JavaScript you would see code like this:

await knex('student').where('deleted', false);

Continue reading