Web Development Articles

Page 124 of 801

How to fix property not existing on EventTarget in TypeScript?

Rushi Javiya
Rushi Javiya
Updated on 01-Aug-2023 7K+ Views

TypeScript is an open-source language that provides optional static typing for JavaScript. It allows developers to write more maintainable code by catching type-related errors at compile-time rather than runtime. However, working with event listeners in TypeScript can be a bit tricky. One common issue is the "property not existing on EventTarget" error. This error occurs when you try to access a property on an event target that TypeScript doesn't recognise. In this article, we will discuss how to fix this error and provide examples to demonstrate how to use event listeners in TypeScript. Understanding the Error Before we dive into ...

Read More

How to get class properties and values using Typescript Reflection?

Rushi Javiya
Rushi Javiya
Updated on 01-Aug-2023 5K+ Views

TypeScript is a superset of JavaScript that provides static typing capabilities, allowing developers to write more reliable and efficient code. One of the most powerful features of TypeScript is its support for reflection. Reflection enables TypeScript developers to inspect and manipulate the properties of classes at runtime, making it easier to write more flexible and dynamic code. In this article, we will explore how to use TypeScript reflection to get class properties and values. We will discuss what reflection is and how it works in TypeScript, provide a brief overview of TypeScript decorators, and then walk through three examples of ...

Read More

TypeScript - Type erasure and error behaviour?

Rushi Javiya
Rushi Javiya
Updated on 01-Aug-2023 344 Views

TypeScript is a popular programming language that offers features such as type checking and type annotations to help developers write more robust and maintainable code. However, when TypeScript code is compiled into JavaScript, the type information is lost in a process called type erasure. This can lead to errors at runtime that are difficult to diagnose and fix. In this article, we will explore the concept of type erasure in TypeScript and how it can affect error behaviour in our code. Type Erasure Type erasure is the process of removing type information from a program during compilation. In TypeScript, this ...

Read More

How is TypeScript an optionally statically typed language?

Rushi Javiya
Rushi Javiya
Updated on 01-Aug-2023 629 Views

TypeScript is an open-source programming language developed and maintained by Microsoft. It is a superset of JavaScript, which means that all valid JavaScript code is also valid TypeScript code. TypeScript adds optional static typing, classes, interfaces, and other features to JavaScript to improve code quality, maintainability, and scalability. In this article, we'll explore how TypeScript is an optionally statically typed language, what that means for developers, and how it can benefit them in their projects. What is Optional Static Typing? Static typing is a programming language feature that allows developers to define data types for variables, function parameters, and function ...

Read More

How to create your own TypeScript type definition files (.d.ts)?

Rushi Javiya
Rushi Javiya
Updated on 01-Aug-2023 5K+ Views

TypeScript, a superset of JavaScript, offers static typing capabilities that enhance code quality and catch errors during compilation. To fully leverage TypeScript's static typing features, it's crucial to have type definition files (.d.ts) for external JavaScript libraries and modules used in projects. These type definition files describe the types and interfaces exposed by the external entities, enabling the TypeScript compiler to understand their shape and behaviour. In this article, we'll explore the step-by-step process of creating custom TypeScript type definition files, empowering developers to benefit from static typing in their projects. Prerequisites Type definition files (.d.ts) serve as an interface ...

Read More

How internal is different from external modules?

Rushi Javiya
Rushi Javiya
Updated on 01-Aug-2023 588 Views

TypeScript, an extension of JavaScript, introduces modules as a means to structure and organize code effectively. Modules play a vital role in developing scalable and maintainable applications by enabling code encapsulation and reusability. TypeScript supports two types of modules: internal (namespaces) and external (ES modules). In this article, we will delve into the differences between internal and external modules in TypeScript, exploring their characteristics and impact on code organization and sharing within a project. Internal Modules Internal modules, also known as namespaces, serve as logical containers within a single file to group related code elements together. They offer benefits such ...

Read More

How to compile .ts automatically with real-time changes in .ts file?

Rushi Javiya
Rushi Javiya
Updated on 01-Aug-2023 2K+ Views

TypeScript is a popular programming language widely used for developing large-scale applications. It is a superset of JavaScript and adds optional static typing, interfaces, and generics to the language. When working with TypeScript, it is crucial to have a smooth development workflow that includes automatically compiling .ts files with real-time changes. In this article, we will explore the different tools and techniques that can be used to achieve this. Why Automatically Compile TypeScript Files? When working on a TypeScript project, developers often make changes to the .ts files. After making changes, they must compile these files to get the corresponding ...

Read More

Sort an alphanumeric string such that the positions of alphabets and numbers remain unchanged

Sonal Meenu Singh
Sonal Meenu Singh
Updated on 01-Aug-2023 1K+ Views

Introduction In this tutorial, we introduce an approach to sorting an alphanumeric string such that the position of alphabets and numbers remains unchanged. In this approach, we use C++ functions and take an input string containing characters and numbers. Generate the string without changing the alphabet and number positions. The newly sorted string contains the shuffled characters in alphabetical order, and arranging the numbers will keep their positions the same. Example 1 String = “”tutorials43points” Output = aiilnoopr34sstttu In the above example, the input string is rearranged without changing the position of the number 32. The characters are ...

Read More

How to Design Half-Page Carousel in Bootstrap?

Asif Rahaman
Asif Rahaman
Updated on 28-Jul-2023 674 Views

Carousel is a popular web designing technique used by web developers. This is a way to show a series of images or any other media content in an interactive way. These carousels are important design elements in several kinds of websites like traveling websites, Educational websites, etc., where we need to attract users using the images. The half-page carousel is a slight variation where the carousel takes only half of the entire page. This article will teach us how to design a half-page carousel in Bootstrap. Use The Grid System The bootstrap grid system allows us to create responsive and ...

Read More

How to design form controls for mobiles using jQuery Mobile Square-UI Theme plugin?

Asif Rahaman
Asif Rahaman
Updated on 28-Jul-2023 222 Views

Making web pages mobile-friendly is a challenging task for the customs form control. jQuery gives us many options to perform the task conveniently. Since smartphones are very popular devices nowadays, it is important to be able to create custom form controls which visually appealing interfaces. jQuery library of JavaScript can help in building both responsive and engaging designs. In this article, we shall learn how to design form control for mobile using jQuery mobile Square-UI Theme plugin. Example This code demonstrates how to design mobile forms using the jQuery Query Mobile Square-UI Theme plugin. We first included the necessary libraries ...

Read More
Showing 1231–1240 of 8,006 articles
« Prev 1 122 123 124 125 126 801 Next »
Advertisements