Book Image

TypeScript for C# and .NET Developers [Video]

By : Ahmad Mohey
Book Image

TypeScript for C# and .NET Developers [Video]

By: Ahmad Mohey

Overview of this book

<p>Starting with a brief introduction to TypeScript, this course starts by revealing how simple it is for a C# developer to move to TypeScript. It focuses on the similarities between both the languages, keeping you within your comfort zone—the Microsoft environment. </p><p>Moving on, it shows you how to work with TypeScript within .NET Core and ASP.NET Core to create powerful and robust applications. You’ll also learn how to integrate third-party tools such as Angular in your development stack. </p><p>By the end of this course, you’ll have gained a solid understanding of how to build maintainable code with TypeScript and see how similar it’s to the tools and language you already know. </p><p> </p><p>All the code and supporting files for this course are available on GitHub at: </p><p>https://github.com/PacktPublishing/-TypeScript-for-CSharp-and-.NET-Developers</p>
Table of Contents (5 chapters)
Chapter 2
TypeScript Language Features
Content Locked
Section 5
Union and Literal Types
These two types are very unique and work in its own way. Union gives one variable to hold or contain more than one datatype based on the developer’s choice, while the literal type is somehow like enumerations, but in a different way, as we shall see. - Study how to create a union type variable and assign different typed values to this variable, based on our declaration of this variable - Explore how literal types work and we can only specify certain elements, that can be set to the variable