Functions and Classes in TypeScript — a practical guide to TypeScript functions classes with clear examples you can reuse in real projects.
Angular Tutorial Series (13/119). Prefer one article? Read the complete Angular tutorial.
Short description
Angular components and services are classes (or functions in newer patterns).
Class sketch
class User {
constructor(public name: string) {}
greet(): string {
return 'Hello ' + this.name;
}
}