Question #1
What is Angular?
1. Short Answer (English)
Angular is a framework used to build web applications.
2. Easy Explanation
Angular is a TypeScript-based framework used to create interactive web applications. It provides tools for components, routing, forms, and other application features.
3. Roman Urdu Explanation
“Angular aik framework hai jo web applications banane ke liye use hota hai. Iski madad se hum website ke different parts ko organize aur manage karte hain.”
4. Code Example
typescriptimport { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: '<h1>Hello Zohaib</h1>'
})
export class AppComponent {}5. Code Explanation (Step-by-Step)
- 1The import statement brings the Component decorator from Angular.
- 2The @Component decorator defines an Angular component.
- 3The selector identifies the component in HTML.
- 4The template displays Hello Zohaib.
- 5The class contains the component logic.
6. Output
The browser displays: Hello Zohaib
7. Behind-the-Scenes Working
Angular reads the component metadata, creates the component, processes its template, and displays the result in the browser. Roman Urdu: Angular component ki information read karta hai, template ko process karta hai aur phir screen par result show karta hai.
8. Common Mistakes
- •Forgetting the Component import.
- •Using an incorrect selector.
- •Writing invalid TypeScript syntax.
9. Practice Task
Create an Angular component that displays your own name.