Skip to content

Commit 38bfd04

Browse files
committed
Improvements of styling and grammatical errors
1 parent 28de8dc commit 38bfd04

File tree

1 file changed

+42
-44
lines changed

1 file changed

+42
-44
lines changed

README.md

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Angular Interview Questions & Answers
22

3-
> Click :star:if you like the project and follow [@SudheerJonna](https://twitter.com/SudheerJonna) for technical updates.
3+
> Click :star: if you like the project and follow [@SudheerJonna](https://twitter.com/SudheerJonna) for technical updates.
44
55
---
66

77
<p align="center">
8-
<a href=https://zerotomastery.io/?utm_source=github&utm_medium=sponsor&utm_campaign=angular-interview-questions>
9-
<img src=https://process.fs.teachablecdn.com/ADNupMnWyR7kCWRvm76Laz/resize=height:70/https://www.filepicker.io/api/file/AKYtjj5SSGyJuyZrkAB2 alt="ZTM Logo" width="100" height="50">
8+
<a href="https://zerotomastery.io/?utm_source=github&utm_medium=sponsor&utm_campaign=angular-interview-questions">
9+
<img src="https://process.fs.teachablecdn.com/ADNupMnWyR7kCWRvm76Laz/resize=height:70/https://www.filepicker.io/api/file/AKYtjj5SSGyJuyZrkAB2" alt="ZTM Logo" width="100" height="50">
1010
</a>
1111
<p align="center">
1212
<ol>
13-
<li>Take this <a href=https://links.zerotomastery.io/angular_sudheer>Angular course</a> to go from a complete Angular beginner to confidently building enterprise-level applications from scratch</li>
14-
<li>Take this <a href=https://links.zerotomastery.io/mci_sudheer3>coding interview bootcamp</a> if youre serious about getting hired and dont have a CS degree</li>
13+
<li>Take this <a href="https://links.zerotomastery.io/angular_sudheer">Angular course</a> to go from a complete Angular beginner to confidently building enterprise-level applications from scratch</li>
14+
<li>Take this <a href="https://links.zerotomastery.io/mci_sudheer3">coding interview bootcamp</a> if you're serious about getting hired and don't have a CS degree</li>
1515
</ol>
1616
</p>
1717
</p>
@@ -163,7 +163,7 @@
163163
|139| [How do you detect route change in Angular?](#how-do-you-detect-route-change-in-angular)|
164164
|140| [How do you pass headers for HTTP client?](#how-do-you-pass-headers-for-http-client)|
165165
|141| [What is the purpose of differential loading in CLI?](#what-is-the-purpose-of-differential-loading-in-cli)|
166-
|142| [Is Angular supports dynamic imports?](#is-angular-supports-dynamic-imports)|
166+
|142| [Does Angular support dynamic imports?](#does-angular-support-dynamic-imports)|
167167
|143| [What is lazy loading?](#what-is-lazy-loading)|
168168
|144| [What are workspace APIs?](#what-are-workspace-apis)|
169169
|145| [How do you upgrade angular version?](#how-do-you-upgrade-angular-version)|
@@ -186,19 +186,19 @@
186186
|162| [What is Angular security model for preventing XSS attacks?](#what-is-angular-security-model-for-preventing-xss-attacks)|
187187
|163| [What is the role of template compiler for prevention of XSS attacks?](#what-is-the-role-of-template-compiler-for-prevention-of-xss-attacks)|
188188
|164| [What are the various security contexts in Angular?](#what-are-the-various-security-contexts-in-Angular)|
189-
|165| [What is Sanitization? Is angular supports it?](#what-is-sanitization?Is-angular-supports-it)|
189+
|165| [What is Sanitization? Does Angular support it?](#what-is-sanitization-does-angular-support-it)|
190190
|166| [What is the purpose of innerHTML?](#what-is-the-purpose-of-innerhtml)|
191191
|167| [What is the difference between interpolated content and innerHTML?](#what-is-the-difference-between-interpolated-content-and-innerhtml)|
192192
|168| [How do you prevent automatic sanitization?](#how-do-you-prevent-automatic-sanitization)|
193-
|169| [Is safe to use direct DOM API methods in terms of security?](#is-safe-to-use-direct-dom-api-methods-in-terms-of-security)|
193+
|169| [Is it safe to use direct DOM API methods in terms of security?](#is-it-safe-to-use-direct-dom-api-methods-in-terms-of-security)|
194194
|170| [What is DOM sanitizer?](#what-is-dom-sanitizer)|
195195
|171| [How do you support server side XSS protection in Angular application?](#how-do-you-support-server-side-xss-protection-in-angular-application)
196-
|172| [Is angular prevents http level vulnerabilities?](#is-angular-prevents-http-level-vulnerabilities)|
196+
|172| [Does Angular prevent HTTP level vulnerabilities?](#does-angular-prevent-http-level-vulnerabilities)|
197197
|173| [What are Http Interceptors?](#what-are-http-interceptors)|
198198
|174| [What are the applications of HTTP interceptors?](#what-are-the-applications-of-http-interceptors)|
199-
|175| [Is multiple interceptors supported in Angular?](#is-multiple-interceptors-supported-in-angular)|
199+
|175| [Are multiple interceptors supported in Angular?](#are-multiple-interceptors-supported-in-angular)|
200200
|176| [How can I use interceptor for an entire application?](#how-can-i-use-interceptor-for-an-entire-application)|
201-
|177| [How does Angular simplifies Internationalization?](#how-does-angular-simplifies-internationalization)|
201+
|177| [How does Angular simplify Internationalization?](#how-does-angular-simplify-internationalization)|
202202
|178| [How do you manually register locale data?](#how-do-you-manually-register-locale-data)|
203203
|179| [What are the four phases of template translation?](#what-are-the-four-phases-of-template-translation)|
204204
|180| [What is the purpose of i18n attribute?](#what-is-the-purpose-of-i18n-attribute)|
@@ -594,9 +594,9 @@
594594
console.log(myService); // MyService
595595
}
596596
}
597-
597+
598598
// Angular v18 and above
599-
599+
600600
import { Component, inject } from '@angular/core';
601601
import { MyService } from './my-service';
602602
@@ -953,7 +953,7 @@
953953
954954
34. ### What is a bootstrapping module?
955955
Every application has at least one Angular module, the root module that you bootstrap to launch the application is called as bootstrapping module. It is commonly known as `AppModule`. The default structure of `AppModule` generated by AngularCLI would be as follows:
956-
956+
957957
```javascript
958958
import { BrowserModule } from '@angular/platform-browser';
959959
import { NgModule } from '@angular/core';
@@ -1582,7 +1582,7 @@
15821582
15831583
78. ### What is AOT?
15841584
Ahead-of-Time (AOT) is a type of compilation that compiles your app at build time. This is the default starting in Angular 9. When you run the ng build (build only) or ng serve (build and serve locally) CLI commands, the type of compilation (JIT or AOT) depends on the value of the aot property in your build configuration specified in angular.json. By default, aot is set to true.
1585-
1585+
15861586
```cmd
15871587
ng build
15881588
ng serve
@@ -2017,7 +2017,7 @@
20172017
```javascript
20182018
import { Component, OnInit, Input } from '@angular/core';
20192019
import { trigger, state, style, animate, transition } from '@angular/animations';
2020-
2020+
20212021
@Component({
20222022
selector: 'app-animate',
20232023
templateUrl: `<div [@changeState]="currentState" class="myblock mx-auto"></div>`,
@@ -2044,11 +2044,11 @@
20442044
]
20452045
})
20462046
export class AnimateComponent implements OnInit {
2047-
2047+
20482048
@Input() currentState;
2049-
2049+
20502050
constructor() { }
2051-
2051+
20522052
ngOnInit() {
20532053
}
20542054
}
@@ -2353,14 +2353,14 @@
23532353
23542354
**[⬆ Back to Top](#table-of-contents)**
23552355
2356-
131. ### what is an rxjs subject in Angular
2356+
131. ### What is an RxJS Subject in Angular?
23572357
An RxJS Subject is a special type of Observable that allows values to be multicasted to many Observers. While plain Observables are unicast (each subscribed Observer owns an independent execution of the Observable), Subjects are multicast.
2358-
2358+
23592359
A Subject is like an Observable, but can multicast to many Observers. Subjects are like EventEmitters: they maintain a registry of many listeners.
23602360
23612361
``` typescript
23622362
import { Subject } from 'rxjs';
2363-
2363+
23642364
const subject = new Subject<number>();
23652365
23662366
subject.subscribe({
@@ -2522,7 +2522,7 @@
25222522
25232523
**[⬆ Back to Top](#table-of-contents)**
25242524
2525-
142. ### Is Angular supports dynamic imports?
2525+
142. ### Does Angular support dynamic imports?
25262526
Yes, Angular 8 supports dynamic imports in router configuration. i.e, You can use the import statement for lazy loading the module using `loadChildren` method and it will be understood by the IDEs(VSCode and WebStorm), webpack, etc.
25272527
Previously, you have been written as below to lazily load the feature module. By mistake, if you have typo in the module name it still accepts the string and throws an error during build time.
25282528
```javascript
@@ -2771,18 +2771,16 @@
27712771
**[⬆ Back to Top](#table-of-contents)**
27722772
27732773
157. ### What is the browser support for Angular?
2774-
Angular supports most recent browsers which includes both desktop and mobile browsers.
2774+
Angular supports most recent browsers which includes both desktop and mobile browsers. As of Angular 13+, IE is no longer supported.
27752775
27762776
| Browser | Version |
27772777
|---- | --------- |
2778-
| Chrome | latest |
2779-
| Firefox | latest |
2778+
| Chrome | 2 most recent major versions |
2779+
| Firefox | 2 most recent major versions |
27802780
| Edge | 2 most recent major versions |
2781-
| IE | 11, 10, 9 (Compatibility mode is not supported) |
27822781
| Safari | 2 most recent major versions |
2783-
| IE Mobile | 11 |
27842782
| iOS | 2 most recent major versions |
2785-
| Android | 7.0, 6.0, 5.0, 5.1, 4.4 |
2783+
| Android | 2 most recent major versions |
27862784
27872785
**[⬆ Back to Top](#table-of-contents)**
27882786
@@ -2834,7 +2832,7 @@
28342832
28352833
**[⬆ Back to Top](#table-of-contents)**
28362834
2837-
165. ### What is Sanitization? Is angular supports it?
2835+
165. ### What is Sanitization? Does Angular support it?
28382836
**Sanitization** is the inspection of an untrusted value, turning it into a value that's safe to insert into the DOM. Yes, Angular supports sanitization. It sanitizes untrusted values for HTML, styles, and URLs but sanitizing resource URLs isn't possible because they contain arbitrary code.
28392837
28402838
**[⬆ Back to Top](#table-of-contents)**
@@ -2897,7 +2895,7 @@
28972895
28982896
**[⬆ Back to Top](#table-of-contents)**
28992897
2900-
169. ### Is safe to use direct DOM API methods in terms of security?
2898+
169. ### Is it safe to use direct DOM API methods in terms of security?
29012899
No,the built-in browser DOM APIs or methods don't automatically protect you from security vulnerabilities. In this case it is recommended to use Angular templates instead of directly interacting with DOM. If it is unavoidable then use the built-in Angular sanitization functions.
29022900
29032901
**[⬆ Back to Top](#table-of-contents)**
@@ -2912,7 +2910,7 @@
29122910
29132911
**[⬆ Back to Top](#table-of-contents)**
29142912
2915-
172. ### Is angular prevents http level vulnerabilities?
2913+
172. ### Does Angular prevent HTTP level vulnerabilities?
29162914
Angular has built-in support for preventing http level vulnerabilities such as as cross-site request forgery (CSRF or XSRF) and cross-site script inclusion (XSSI). Even though these vulnerabilities need to be mitigated on server-side, Angular provides helpers to make the integration easier on the client side.
29172915
1. HttpClient supports a token mechanism used to prevent XSRF attacks
29182916
2. HttpClient library recognizes the convention of prefixed JSON responses(which non-executable js code with ")]}',\\n" characters) and automatically strips the string ")]}',\\n" from all responses before further parsing
@@ -2971,7 +2969,7 @@
29712969
29722970
**[⬆ Back to Top](#table-of-contents)**
29732971
2974-
175. ### Is multiple interceptors supported in Angular?
2972+
175. ### Are multiple interceptors supported in Angular?
29752973
Yes, Angular supports multiple interceptors at a time. You could define multiple interceptors in providers property:
29762974
```javascript
29772975
providers: [
@@ -3018,7 +3016,7 @@
30183016
30193017
**[⬆ Back to Top](#table-of-contents)**
30203018
3021-
177. ### How does Angular simplifies Internationalization?
3019+
177. ### How does Angular simplify Internationalization?
30223020
30233021
Angular simplifies the below areas of internationalization,
30243022
1. Displaying dates, number, percentages, and currencies in a local format.
@@ -4171,7 +4169,7 @@
41714169
```js
41724170
import { Component } from '@angular/core';
41734171
import { FormControl } from '@angular/forms';
4174-
4172+
41754173
@Component({
41764174
selector: 'user-profile',
41774175
styleUrls: ['./user-profile.component.css'],
@@ -4613,7 +4611,7 @@
46134611
A component harness is a testing API around an Angular directive or component to make tests simpler by hiding implementation details from test suites. This can be shared between unit tests, integration tests, and end-to-end tests. The idea for component harnesses comes from the **PageObject** pattern commonly used for integration testing.
46144612
46154613
**[⬆ Back to Top](#table-of-contents)**
4616-
4614+
46174615
273. ### What is the benefit of Automatic Inlining of Fonts?
46184616
During compile time, Angular CLI will download and inline the fonts that your application is using. This performance update speed up the first contentful paint(FCP) and this feature is enabled by default in apps built with version 11.
46194617
@@ -4634,20 +4632,20 @@
46344632
46354633
**[⬆ Back to Top](#table-of-contents)**
46364634
4637-
277. ### How to create a standalone component uing CLI command?
4635+
277. ### How to create a standalone component using CLI command?
46384636
4639-
Generate standalone component using CLI command as shown below
4637+
Generate a standalone component using the CLI command as shown below:
46404638
```bash
46414639
ng generate component component-name --standalone
46424640
```
46434641
On running the command standalone component is created.
46444642
Here is the list of file created.
4645-
4643+
46464644
1. `component-name.component.ts`
46474645
2. `component-name.component.css`
46484646
3. `component-name.component.spec`
46494647
4. `component-name.component.html`
4650-
4648+
46514649
Next need to update `app.module.ts` as shown below.
46524650
46534651
```typescript
@@ -4706,14 +4704,14 @@
47064704
})
47074705
export class AppModule {}
47084706
```
4709-
4707+
47104708
**[⬆ Back to Top](#table-of-contents)**
47114709
47124710
279. ### What is hydration?
47134711
Hydration is the process that restores the server side rendered application on the client. This includes things like reusing the server rendered DOM structures, persisting the application state, transferring application data that was retrieved already by the server, and other processes.
47144712
47154713
To enable hydration, we have to enable server side rendering or Angular Universal. Once enabled, we can add the following piece of code in the root component.
4716-
4714+
47174715
```typescript
47184716
import {
47194717
bootstrapApplication,
@@ -4737,14 +4735,14 @@
47374735
})
47384736
export class AppModule {}
47394737
```
4740-
4738+
47414739
**[⬆ Back to Top](#table-of-contents)**
47424740
47434741
280. ### What are Angular Signals?
47444742
A signal is a wrapper around a value that can notify interested consumers when that value changes. Signals can contain any value, from simple primitives to complex data structures.
47454743
47464744
**[⬆ Back to Top](#table-of-contents)**
4747-
4745+
47484746
281. ### Explain Angular Signals with an example.
47494747
In this example, we create a signal named `count` and initialize it with a value of 0. We then connect to the signal, allowing us to be notified whenever its value changes. Finally, we add a button that increments the count when clicked.
47504748

0 commit comments

Comments
 (0)