Write a simple Angular app in TypeScript
  • References/JavaScript/TypeScript/Tutorials

Write a simple Angular app in TypeScript First, change the code in app.ts to:

2025-01-10 15:47:30
Minimal project
  • References/JavaScript/TypeScript/Tutorials

Minimal project Let’s start out with a new directory. We’ll name it proj for now, but you can change it to whatever you want.

2025-01-10 15:47:30
Discriminated Unions
  • References/JavaScript/TypeScript/Advanced Types

Discriminated Unions You can combine string literal types, union types, type guards, and type aliases to build an advanced pattern called discriminated

2025-01-10 15:47:30
Block-scoped variable capturing
  • References/JavaScript/TypeScript/Variable Declarations

Block-scoped variable capturing When we first touched on the idea of variable capturing with var declaration, we briefly went into

2025-01-10 15:47:30
Compiler Options
  • References/JavaScript/TypeScript/Project Configuration

Compiler Options Option Type Default Description --allowJs

2025-01-10 15:47:30
User-Defined Type Guards
  • References/JavaScript/TypeScript/Advanced Types

User-Defined Type Guards Notice that we had to use type assertions several times. It would be much better if once we performed the check, we

2025-01-10 15:47:30
Null and Undefined
  • References/JavaScript/TypeScript/Basic Types

Null and Undefined In TypeScript, both undefined and null actually have their own types named undefined

2025-01-10 15:47:30
Install our build dependencies
  • References/JavaScript/TypeScript/Tutorials

Install our build dependencies First ensure TypeScript and Typings are installed globally.

2025-01-10 15:47:30
Write some code
  • References/JavaScript/TypeScript/Tutorials

Write some code Let’s write our first TypeScript file using Knockout. First, create a new file in your src directory named hello

2025-01-10 15:47:30
Block-scoping
  • References/JavaScript/TypeScript/Variable Declarations

Block-scoping When a variable is declared using let, it uses what some call lexical-scoping or block-scoping

2025-01-10 15:47:30