Understanding why Semantic HTML is important, as told by TypeScript

What a great technological analogy by Mandy Michael. A reminder that TypeScript…
makes use of static typing so, for example, you can give your variables a type when you write your code and then TypeScript checks the types at compile time and will throw an error if the variable is given a value of a different type.
In other words, you have a variable age that you declare to be a number, the value for age has to stay …
The post Understanding why Semantic HTML is important, as told by TypeScript appeared first on CSS-Tricks.

Link: https://medium.com/@mandy.michael/understanding-why-semantic-html-is-important-as-told-by-typescript-bd71ad41e6c4

Creating a Custom Element Decorator Using TypeScript

It’s a known fact that I’m betting on Web Components. The last time that I delivered a session about Web Components, someone in the audience asked me how he can remove some of the boilerplate he needs to write in order to create a custom element. I answered that you can probably use a compiler such as Stencil or a library such as Polymer or even write your own TypeScript decorator to do that.
So… a few days ago I had some spare time to sit and play with both Custom Elements and TypeScript decorators. As a result, I wrote a small code snippet that can help you to get started and build your own custom element decorator.

Link: https://dzone.com/articles/creating-a-custom-element-decorator-using-typescri?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

How to Inherit a Class in TypeScript

Just like any other OOP supported language, TypeScript also allows you to inherit a base class. In the last article, we learned how to create a class in TypeScript. We have also learned how to create a constructor and how to instantiate a class object.
In this article of the TypeScript Tutorial for beginners series, we will learn how to inherit a TypeScript class.

Link: https://dzone.com/articles/how-to-inherit-a-class-in-typescript?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

How to Define an Interface in TypeScript

An interface in TypeScript contains only the declaration of the methods and properties, but not the implementation. It is the responsibility of the class that implements the interface by providing the implementation for all the members of the interface.
Today, in this TypeScript tutorial, we will learn how to work with interfaces in TypeScript. Continue reading to learn more.

Link: https://dzone.com/articles/how-to-define-an-interface-in-typescript?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

How to Define a Class in TypeScript

Earlier in this TypeScript tutorial series, we learned about the TypeScript configuration file, variable declaration, and basic data types. I hope I made it neat and clear to understand the very basics of TypeScript.
Today, in this article, we will learn how to define a class and instantiate a class object. Continue reading to learn more.

Link: https://dzone.com/articles/how-to-define-a-class-in-typescript?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

Angular 6, Part 2: An Overview of Components

If you are new to the Angular framework or just finding out why Angular is popular in the web development, then this series of articles is for you. Through this series of articles, you can learn about every aspect or benefit of Angular, including how to use it in your own development.
Angular is a component-based framework. Components are the main building blocks of the Angular framework. So, as per the definition of a component, it is a basically a class which is defined to be visible in any elements in the screen or browsers. For defining the component in Angular, we need to use the @Component() decorator. In fact, components are a really a unique idea. Because each of the component classes represents an independent unit which is highly reusable and can be maintained without hampering the other components.

Link: https://dzone.com/articles/angular-5-part-2-an-overview-of-components?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

What Are the Basic Data Types in TypeScript?

Like JavaScript and any other language, TypeScript also provides basic data types to handle numbers, strings, etc. Some common data types in TypeScript are: number, string, boolean, enum, void, null, undefined, any, never, Array and tuple.
Let’s learn more about these basic data types of TypeScript, which you will always need to use. Let’s learn with suitable examples.

Link: https://dzone.com/articles/what-are-the-basic-data-types-in-typescript?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

How to Declare Variables in TypeScript

In the previous few chapters of this TypeScript Tutorial series, we learned how to install TypeScript and then created a simple HelloWorld application. We have also learned about the TypeScript configuration file (tsconfig.json).
In this post, we will learn various ways to declare variables in TypeScript.

Link: https://dzone.com/articles/how-to-declare-variables-in-typescript?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

What Is the tsconfig.json Configuration File?

The tsconfig.json file allows you to specify the root level files and the compiler options that requires to compile a TypeScript project. The presence of this file in a directory specifies that the said directory is the TypeScript project root.
In this chapter of the TypeScript Tutorial series, we will learn about tsconfig.json, it’s various properties, and how to extend it.

Link: https://dzone.com/articles/what-is-the-tsconfigjson-configuration-file?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

Building Your First ‘Hello World’ TypeScript Application

If you have read the previous chapter of the TypeScript Tutorial series, you have already learned how to install Node.js and TypeScript and might have already installed those. Now, it’s the time to go a step further to learn how to write code in TpeScript.
In this article, we will learn how to create a simple HelloWorld application, compile it and run it. Continue reading to learn more.

Link: https://dzone.com/articles/building-your-first-hello-world-typescript-applica?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev