0% found this document useful (0 votes)
5 views2 pages

Basic Angular Coding Questions

Uploaded by

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

Basic Angular Coding Questions

Uploaded by

tejal.12.sankpal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Basic Angular Coding Questions

1. How do you create a new component in Angular?

o What command do you use?

o Can you create a component inside a specific folder?

2. How do you share data between two components?

o Parent to child using @Input()

o Child to parent using @Output() and EventEmitter

o Sibling to sibling using a shared service

3. How do you make HTTP requests in Angular?

o Example of [Link]() or post()

o How to handle response and errors using subscribe() or pipe() with catchError

4. How do you use Reactive Forms?

o Create a form using FormGroup, FormControl

o Add validators like [Link]

o Submit form and access form values

5. What is two-way data binding and how is it done in Angular?

o Syntax: [(ngModel)]

o Example with a text input and updating a variable in component

🔹 Intermediate Coding Questions

6. How do you use ngFor and ngIf in templates?

o Loop over an array using *ngFor

o Conditionally render HTML using *ngIf

7. How do you create a custom pipe?

o Transform a string to uppercase/lowercase

o Format a date or filter a list

8. How do you implement routing in Angular?

o Set up RouterModule and routes array

o Use routerLink in template

o Navigate programmatically using [Link]()

9. How do you display a loading spinner while an API call is in progress?


o Use a boolean flag isLoading

o Show/hide spinner based on flag

10. How do you use services and dependency injection?

 Create a service with @Injectable()

 Inject service into component constructor

 Use methods defined in the service

🔹 Common Code Snippets You Should Practice

1. Component communication (Input/Output)

2. Form validation and submission

3. HTTP GET/POST with loading and error handling

4. Routing with parameters (/users/:id)

5. Search/filter a list with a text input

6. Display data from API using ngFor

7. Use of async pipe in templates with Observables

🔹 Bonus: Behavioral/Practical Questions

 How do you debug Angular applications?

 What kind of performance issues have you faced and how did you solve them?

 What folder structure do you follow for organizing components, services, models, etc.?

You might also like