Module 1
TypeScript & Angular foundations
Set up an Angular app and understand the typed language used throughout it.
- FrontendDost Angular: Angular CLI & Project Structure
Open simple lesson
Key points to remember
- Annotate values with types such as string, number, boolean, and arrays like string[].
- Use interfaces to describe object shapes and union types when a value has a small set of valid forms.
- Use generics to keep reusable functions and collections type-safe.
- Check nullable values before using them; strict TypeScript catches many mistakes before runtime.
Small example
interface Learner { name: string; level: "beginner" | "advanced"; topics: string[]; } function firstItem<T>(items: T[]): T | undefined { return items[0]; } const learner: Learner = { name: "Asha", level: "beginner", topics: ["components"], };Try it yourself
Create a Course interface with title, lessonCount, and a level union. Write a typed function that safely returns the first course or undefined.
- FrontendDost Angular: Angular CLI & Project Structure
Open simple lesson
Key points to remember
- Use the Angular CLI to create, serve, test, and build an application.
- A standalone component declares the directives, pipes, or child components it uses in imports.
- Keep app configuration and route definitions close to the application entry point.
- Use a production build for deployment; the development server is for local work.
Small example
ng new learning-app cd learning-app ng serve // A standalone component declares its template dependencies: @Component({ selector: "app-root", imports: [CommonModule], template: "<h1>Learning Angular</h1>", }) export class AppComponent {}Try it yourself
Create a small standalone Angular app, run it locally, and identify its root component, route configuration, and global styles.
- FrontendDost Angular: Standalone Components
Open simple lesson
Key points to remember
- A component combines a TypeScript class, template, styles, and Angular metadata.
- Keep a component focused on one UI responsibility.
- Use component state to provide values to the template.
- Standalone components list template dependencies in their imports array.
Small example
@Component({ selector: "app-greeting", standalone: true, template: "<h1>Hello, {{ name }}!</h1>", }) export class GreetingComponent { name = "Asha"; }Try it yourself
Create a profile-card component that displays a name and a short description. Keep the data in the component class and the markup in its template.
- FrontendDost Angular: Property & Event Binding
Open simple lesson
Key points to remember
- Interpolation {{ value }} displays text from a component.
- Property binding [disabled]="isSaving" sets an element property from component state.
- Event binding (click)="save()" calls component behavior after user interaction.
- Use @if for conditional content and @for with a track expression for repeated items.
Small example
@if (topics.length === 0) { <p>No topics yet.</p> } @else { <ul> @for (topic of topics; track topic.id) { <li>{{ topic.title }}</li> } </ul> } <button [disabled]="isSaving" (click)="save()">Save</button>Try it yourself
Render a list of lessons with @for. Show an empty message with @if, and disable a button while a save is in progress.