Running javascript and typescript unit tests in Microsoft Visual Studio 2012...
To unit test my JavaScript files in Microsoft Visual Studio 2012, side by side mine C# unit tests, I use Chutzpah. Chutzpah comes with 2 Microsoft Visual Studio 2012 extensions: 1. Chutzpah Test...
View ArticleHow to create an Angular v1.3 directive, when using the ControllerAs syntax...
The following link exactly describes, how I create my Angular v1.3 directives: http://kwilson.me.uk/blog/writing-cleaner-angularjs-with-typescript-and-controlleras/
View ArticleHow to get full class name, including module name from an instance at runtime...
Let’s assume we have the class [GuidGenerator] in a TypeScript module [research.my.long.namespace] and at runtime you have an instance of the GuidGenerator, how do you get the full class name including...
View ArticleFix: TypeScript 1.7.6 compile on save in Visual Studio 2015 not working
I upgraded Visual Studio 2015 TypeScript extension to 1.7.6, then compile on save stopped working. First I checked if “Compile on save” was enabled on my 4.5.2 web project properties (TypeScript Build...
View ArticleStarting with ASP.NET 5, TypeScript 1.7 and the ES6 module syntax compiled to...
In the previous post I described how you can get started with ASP.NET 5. The code used in this blog post can be found at:...
View ArticleYes: Cycle.js is getting some TypeScript love
In his blog post: http://staltz.com/all-js-libraries-should-be-authored-in-typescript.html mentions: I am a JavaScript programmer, and I make some libraries. Recently, however, I’ve been writing...
View ArticleSome nice new features are coming to TypeScript
npm for type definition files One of the things that annoyed me was the tsd tool for installing type definition files. Why can’t I just use npm, for installing type definition files. I use npm for...
View ArticleFix: Visual Studio doesn’t use or can’t find TypeScript typings (*.d.ts) in a...
I added some TypeScripts typings to a .net core project in Visual Studio 2015 (version 14.0.25123.00 Update 2), by using the NPM package “typings”, but the added *.d.ts files, were not picked up by...
View ArticleCommunicate between controllers in Angular by using a simple pubsub service...
I created a really simple angular PubSubService in TypeScript, to allow communication between controllers or directives or services. In the example below, controller 1, fires an event and...
View ArticleWhy you should almost always use const and sometimes let, but never var in...
A nice article on “Variable and Function Hoisting in ES2015”:...
View ArticleA very simple and unsafe :-), self-signed, CORS https node.js dev stub...
const https = require("https"); const fs = require("fs"); // To create the key.pem and cert.pem files for dev, use opensll: // openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem...
View ArticleHow to run Angular e2e tests written in TypeScript with Cucumber and Protractor
If you want to run your end to end tests with cucumber instead of jasmine, then create a new Angular app: ng new angular-cli-cucumber-demo and follow the steps on...
View ArticleReplace absolute paths with relative paths in TypeScript files
Just some small Power Shell script to replace absolute paths with relative paths in TypeScript. I needed this because inside an Angular Library NPM package we where using tsconfig ‘path mapping’, but...
View Article