0% found this document useful (0 votes)
21 views6 pages

Viva

The document provides an overview of Angular, a JavaScript framework for building single-page applications, highlighting its key features such as two-way data binding, modular architecture, and the use of TypeScript. It covers various aspects of Angular development including project structure, components, services, routing, forms, and HTTP services. Additionally, it discusses TypeScript fundamentals, classes, objects, and deployment processes for Angular applications.

Uploaded by

kapil agrawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views6 pages

Viva

The document provides an overview of Angular, a JavaScript framework for building single-page applications, highlighting its key features such as two-way data binding, modular architecture, and the use of TypeScript. It covers various aspects of Angular development including project structure, components, services, routing, forms, and HTTP services. Additionally, it discusses TypeScript fundamentals, classes, objects, and deployment processes for Angular applications.

Uploaded by

kapil agrawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Unit 1: Introduction

1. Q: What is Angular?
A: JavaScript framework for building single-page applications.
2. Q: What is the purpose of Angular?
A: To build complex web applications with ease.
1. What is Angular?
→ A front-end JavaScript framework used to build dynamic web applications.
2. What are the key features of Angular?
→ Two-way data binding, dependency injection, modular architecture, and component-based
development.
3. What is the role of TypeScript in Angular?
→ TypeScript is the primary language for Angular development, adding static typing and advanced
features.
4. What is a Single Page Application (SPA)?
→ An application that loads a single HTML page and dynamically updates the content without
refreshing.
5. What is Data Binding?
→ A technique that connects UI components with the data model.
6. What are the types of data binding in Angular?
→ One-way binding, two-way binding, property binding, and event binding.
7. What is the purpose of Directives in Angular?
→ Directives modify DOM elements and behavior (ngFor, ngIf, etc.).
8. What is an Angular Component?
→ A class that controls a part of the UI and contains HTML, CSS, and logic.
9. What is the purpose of @Component in Angular?
→ It is a decorator that defines metadata for an Angular component.
10. What is the difference between AngularJS and Angular?
→ AngularJS is JavaScript-based (version 1.x), while Angular (2+) uses TypeScript and has better
performance.

Unit 2: Angular Projects/Programs


3. Q: What is an Angular project?
A: A collection of files and folders for building Angular applications.
4. Q: How do you create a new Angular project?
A: Using the Angular CLI command "ng new project-name".
11. What is Angular CLI?
→ A command-line tool to create, manage, and build Angular applications.
12. How do you create a new Angular project?
→ Using the command: ng new project-name.
13. What is the purpose of package.json in Angular
→ It manages dependencies and project configurations.
14. What is the structure of an Angular project?
→ It contains folders like src, app, assets, environments, and configuration files.
15. What is Webpack in Angular?
→ A module bundler used for compiling Angular applications.
16. What are Angular Modules?
→ Modules organize Angular apps into functional units using @NgModule.
17. What is a Lazy Loaded Module?
→ A module that is loaded only when needed to improve performance.
18. What is a Service in Angular?
→ A class used for reusable logic, like fetching data from an API.
19. What is Dependency Injection?
→ A design pattern where Angular automatically injects services into components.
20. How do you run an Angular application?
→ Use ng serve to start the development server.

Unit 3: Type Script Fundamentals


5. Q: What is TypeScript?
A: Superset of JavaScript, adds optional static typing.
6. Q: Why use TypeScript?
A: Improves code maintainability, catches errors early.
21. What is TypeScript?
→ A superset of JavaScript that adds static typing and advanced features.
22. What are the key features of TypeScript?
→ Static typing, interfaces, classes, modules, and decorators.
23. How do you declare variables in TypeScript?
→ Using let, const, or var.
24. What is an Interface in TypeScript?
→ A contract that defines the structure of an object.
25. What is an Arrow Function in TypeScript?
→ A shorthand way to define functions using =>.
26. What are Enums in TypeScript?
→ A way to define named constant values.
27. What is Type Assertion in TypeScript?
→ A way to explicitly tell the compiler about a variable's type using as or <type>.
28. What is the difference between "let" and "const"?
→ let allows reassignment, while const does not.
29. What is a Decorator in TypeScript?
→ A special function used to modify classes, methods, or properties.
30. What are Generics in TypeScript?
→ A feature that allows writing reusable, type-safe code.

Unit 4: Classes and Objects in Angular


7. Q: What is a class in Angular?
A: Blueprint for creating objects, defines properties and methods.
8. Q: How do you create an object in Angular?
A: Using the "new" keyword, e.g., "let obj = new MyClass();"
31. What is a Class in TypeScript?
→ A blueprint for creating objects with properties and methods.
32. What is an Object in TypeScript?
→ An instance of a class that contains values and methods.
33. What is the role of a Constructor in TypeScript?
→ A special method for initializing an object.
34. What are Access Modifiers in TypeScript?
→ public, private, and protected control access to class properties.
35. What is an Angular Module?
→ A collection of components, services, and other features grouped together.
36. What is @Injectable in Angular?
→ A decorator that makes a class a service that can be injected.
37. What is the difference between Promises and Observables?
→ Promises handle single values, while Observables handle multiple values over time.
38. What is RxJS in Angular?
→ A library for handling reactive programming and Observables.
39. What is a Pipe in Angular?
→ A feature that formats data before displaying it in the template.
40. What is the purpose of Interpolation in Angular?
→ It binds dynamic data to the HTML template using {{ }}.

Unit 5: Angular Fundamentals


9. Q: What is a module in Angular?
A: Container for related components, services, and directives.
10. Q: What is a component in Angular?
A: Reusable piece of code, represents UI element.
41. What is Routing in Angular?
→ A feature that navigates between different views using RouterModule.
42. What are Guards in Angular?
→ Services that control access to routes (CanActivate, CanDeactivate).
43. What is an HTTP Interceptor?
→ A service that modifies HTTP requests or responses globally.
44. What is Form Validation in Angular?
→ A process that ensures user input is correct using built-in or custom validators.
45. What is the purpose of ngOnInit?
→ A lifecycle hook that runs when a component initializes.
46. What is Change Detection in Angular?
→ A process that updates the UI when data changes.
47. What is Server-Side Rendering (SSR) in Angular?
→ A technique that improves performance by rendering Angular on the server.
48. What is Angular Universal?
→ A tool that enables server-side rendering for Angular applications.
49. What is the purpose of ng-content?
→ It is used to project content into an Angular component.
50. What is Deployment in Angular?
→ The process of making an Angular application live on a server or cloud.

Unit 6: Displaying Data and Handling Events


11. Q: How do you display data in Angular?
A: Using interpolation, e.g., "{{ data }}".

12. Q: How do you handle events in Angular?


A: Using event binding, e.g., "(click)='handleClick()'".

Unit 7: Directives
13. Q: What is a directive in Angular?
A: Custom attribute or element, adds functionality to HTML.

14. Q: What is the purpose of the "ngIf" directive?


A: Conditionally includes or excludes HTML elements.

Unit 8: Building Re-usable Components


15. Q: How do you create a reusable component in Angular?
A: Using the Angular CLI command "ng generate component component-name".

16. Q: What is the purpose of the "@Input" decorator?


A: Passes data from parent to child component.

Unit 9: Template-driven Forms


17. Q: What is a template-driven form in Angular?
A: Form that uses HTML templates to define form structure.

18. Q: What is the purpose of the "ngModel" directive?


A: Binds form control to a property in the component.

Unit 10: Form Handling in Angular


19. Q: How do you handle form submission in Angular?
A: Using the "ngSubmit" event, e.g., "(ngSubmit)='handleSubmit()'".

20. Q: What is the purpose of the "FormsModule"?


A: Provides directives for building template-driven forms.

Unit 11: Consuming HTTP Services


21. Q: How do you make an HTTP request in Angular?
A: Using the "HttpClient" service, e.g., "this.http.get('url')".

22. Q: What is the purpose of the "HttpClientModule"?


A: Provides the "HttpClient" service for making HTTP requests.

Unit 12: Routing and Navigation


23. Q: What is routing in Angular?
A: Mechanism for navigating between views based on URL.

24. Q: How do you define routes in Angular?


A: Using the "Routes" array in the routing module.

Unit 13: Authentication and Authorization


25. Q: What is authentication in Angular?
A: Process of verifying user identity.

26. Q: How do you implement authentication in Angular?


A: Using a library like Angular Auth or implementing custom logic.

Unit 14: Deployment


27. Q: How do you deploy an Angular application?
A: Using the Angular CLI command "ng build" and then deploying to a server.

28. Q: What is the purpose of the "angular.json" file?


A: Configures the Angular CLI and build process.

Additional Questions
29. Q: What is the difference between "var", "let", and "const" in TypeScript?
A: "var" is function-scoped, "let" and "const" are block-scoped.

30. Q: How do you use the "async/await" syntax in Angular?


A: To write asynchronous code that is easier to read and maintain.

31. Q: What is the purpose of the "Pipe" concept in Angular?


A: To transform data in templates.
32. Q: How do you use the "ngFor" directive in Angular?
A: To iterate over arrays and render templates.

33. Q: What is the difference between "ngIf" and "ngShow" directives?


A: "ngIf" removes the element, "ngShow"

General AngularJS and Angular Questions:


1. What is AngularJS?
AngularJS is a JavaScript framework for building dynamic single-page applications with two-
way data binding and MVC architecture.
2. Why use AngularJS?
AngularJS simplifies dynamic web application development using two-way binding,
dependency injection, and modular architecture.
3. What is Angular?
Angular is a TypeScript-based framework for creating scalable, dynamic web applications
using component-based architecture and reactive programming.
4. What are the key features of AngularJS?
Features include data binding, directives, dependency injection, routing, MVC architecture,
and reusable components.
5. What are Angular Components?
Angular components are building blocks of the UI, combining templates, styles, and logic for
reusability.

Development Environment:
6. How do you set up an AngularJS environment?
Install Node.js, Angular CLI, and create a project using ng new command.
7. What is the role of the Angular CLI?
CLI simplifies Angular project creation, building, testing, and deployment with built-in
commands.

TypeScript Fundamentals:
8. What is TypeScript?
TypeScript is a statically typed superset of JavaScript that compiles to JavaScript, enhancing
productivity and maintainability.
9. What are TypeScript's advantages over JavaScript?
TypeScript offers static typing, interfaces, classes, enhanced tooling, and error checking.
10. What are TypeScript’s primitive types?
Types include number, string, boolean, null, undefined, void, and any.

Architecture and Features:


11. What is MVC architecture in AngularJS?
MVC divides applications into Model (data), View (UI), and Controller (logic) components for
organized development.
12. Explain Dependency Injection in Angular.
Dependency Injection provides components with their dependencies, improving modularity,
reusability, and testability.
13. What is the purpose of directives in AngularJS?
Directives extend HTML with custom behavior, such as ng-model and ng-bind.

Forms and Components:


14. What are template-driven forms in Angular?
Forms created using Angular templates with two-way data binding and validation.
15. How does Angular handle data binding?
Angular provides one-way and two-way data binding for synchronizing UI and data
dynamically.

Routing and Navigation:


16. What is Angular routing?
Angular routing enables navigation between views in single-page applications using
RouterModule.
17. How does lazy loading work in Angular?
Lazy loading loads modules only when required, improving app performance.

Testing and Deployment:


18. What is Karma in Angular?
Karma is a test runner used for unit testing Angular applications.
19. How do you deploy an Angular application?
Use ng build to create a production build and host it on a server or service.

Miscellaneous:
20. What is RxJS in Angular?
RxJS is a library for reactive programming, managing asynchronous data streams with
observables.

You might also like