I was just in between of my sample project, wherein I have just finished the backend design and I was writing the Client Side Test for Testing WEB-API, whether it is up and running. First of all, you need to install QUNIT For MVC from nuget. Upon, installing the same, it will bring QUNIT related files in Content and Scripts folder. However, for my sake of interest, I have kept the same under one folder as shown below in the screenshot.
In this section, we will look at the C# Interactive Coding Window. This is the new feature added in VS 2015 Update 1. This is one of the coolest experimental thing to test your snippet quickly in the editor itself. First of all, In order to open the C# interactive, you need to navigate to View –> Other Windows –> C# Interactive as shown below in the snapshot.
In this section, we are going to talk about Modules. Modules, keep the code separated. In many ways, it help users to keep the code neat and clean. It’s something like we are going to keep different unit of works in different placeholders or you say in different files. By separating the code out, it enhances the productivity immensely, like test-ability and re-usability enhances immensely. This way, your code not only appears robust, but it also follows good pattern like code-of-separation and solid. Now, we explicitly declare module with the name module itself. From C# perspective, you can also think modules as equivalent to namespaces.
In this section, we will see how to use third party libraries like jquery or angular or anything with TypeScript. TypeScript, provides this flexibility to use any third party libraries on the top of your TS file, using some interface. And, this interface is called Definitely Typed in TypeScript. Here, is the URL of Definitely Typedhttp://definitelytyped.org/. Once you open the same, it will open the following page.
In this section, we will delve further and see how to work with Interfaces using TypeScript. Below, I have created a very simple and straightforward interface and class. Here, class Implements the interface.
In this section, we are going to look creation and implementation of classes in TypeScript. TypeScript provides built in support for class. I have already discussed in the last post, if you are coming from the background C# or Java, then you must be familiar with class. Basically, a class is container whose role is to contain code means making a reusable stuff, such that same can be used time and again.
In this section, we will continue from the last segment and delve further in TypeScript. In this section, we will look how to use interfaces with TypeScript. If you are coming from system’s language background say C# or JAVA, you must be knowing different OOPs terminology and Interfaces are one of the key concepts for enforcing constraints on implementing classes. Let us go ahead and jump at demos.
Now, if I hover on the same, it will show the type any.