Skip to content

Commit 8b1b260

Browse files
committed
2 parents e460774 + 4d21a8f commit 8b1b260

File tree

1 file changed

+27
-30
lines changed

1 file changed

+27
-30
lines changed

README.md

+27-30
Original file line numberDiff line numberDiff line change
@@ -318,32 +318,32 @@ You can download the PDF and Epub version of this repository from the latest run
318318

319319
1. ### What is Angular Framework?
320320

321-
Angular is a **TypeScript-based open-source** front-end platform that makes it easy to build applications with in web/mobile/desktop. The major features of this framework such as declarative templates, dependency injection, end to end tooling, and many more other features are used to ease the development.
321+
Angular is a **TypeScript-based open-source** front-end platform that makes it easy to build web, mobile and desktop applications. The major features of this framework include declarative templates, dependency injection, end to end tooling which ease application development.
322322

323323
**[⬆ Back to Top](#table-of-contents)**
324324

325325
2. ### What is the difference between AngularJS and Angular?
326326
Angular is a completely revived component-based framework in which an application is a tree of individual components.
327327

328-
Some of the major difference in tabular form
328+
Here are some of the major differences in tabular format:-
329329

330330
| AngularJS | Angular |
331331
|---- | ---------
332332
| It is based on MVC architecture| This is based on Service/Controller|
333-
| It uses JavaScript to build the application| Introduced the TypeScript to write the application|
333+
| It uses JavaScript to build the application| Uses TypeScript to build the application|
334334
| Based on controllers concept| This is a component based UI approach|
335-
| Not a mobile friendly framework| Developed considering mobile platform|
336-
| Difficulty in SEO friendly application development| Ease to create SEO friendly applications|
335+
| No support for mobile platforms| Fully supports mobile platforms|
336+
| Difficult to build SEO friendly application| Ease to build SEO friendly applications|
337337

338338
**[⬆ Back to Top](#table-of-contents)**
339339

340340
3. ### What is TypeScript?
341-
TypeScript is a typed superset of JavaScript created by Microsoft that adds optional types, classes, async/await, and many other features, and compiles to plain JavaScript. Angular built entirely in TypeScript and used as a primary language.
342-
You can install it globally as
341+
TypeScript is a strongly typed superset of JavaScript created by Microsoft that adds optional types, classes, async/await and many other features, and compiles to plain JavaScript. Angular is written entirely in TypeScript as a primary language.
342+
You can install TypeScript globally as
343343
```cmd
344344
npm install -g typescript
345345
```
346-
Let's see a simple example of TypeScript usage,
346+
Let's see a simple example of TypeScript usage:-
347347
```typescript
348348
function greeter(person: string) {
349349
return "Hello, " + person;
@@ -358,17 +358,17 @@ You can download the PDF and Epub version of this repository from the latest run
358358
**[⬆ Back to Top](#table-of-contents)**
359359
360360
4. ### Write a pictorial diagram of Angular architecture?
361-
The main building blocks of an Angular application is shown in the below diagram
361+
The main building blocks of an Angular application are shown in the diagram below:-
362362
![ScreenShot](images/architecture.png)
363363
364364
**[⬆ Back to Top](#table-of-contents)**
365365
366366
5. ### What are the key components of Angular?
367-
Angular has the below key components,
368-
1. **Component:** These are the basic building blocks of angular application to control HTML views.
369-
2. **Modules:** An angular module is set of angular basic building blocks like component, directives, services etc. An application is divided into logical pieces and each piece of code is called as "module" which perform a single task.
370-
3. **Templates:** This represent the views of an Angular application.
371-
4. **Services:** It is used to create components which can be shared across the entire application.
367+
Angular has the key components below,
368+
1. **Component:** These are the basic building blocks of an Angular application to control HTML views.
369+
2. **Modules:** An Angular module is a set of angular basic building blocks like components, directives, services etc. An application is divided into logical pieces and each piece of code is called as "module" which perform a single task.
370+
3. **Templates:** These represent the views of an Angular application.
371+
4. **Services:** Are used to create components which can be shared across the entire application.
372372
5. **Metadata:** This can be used to add more data to an Angular class.
373373
374374
**[⬆ Back to Top](#table-of-contents)**
@@ -631,17 +631,20 @@ You can download the PDF and Epub version of this repository from the latest run
631631
**[⬆ Back to Top](#table-of-contents)**
632632
633633
15. ### What is the difference between constructor and ngOnInit?
634-
TypeScript classes has a default method called constructor which is normally used for the initialization purpose. Whereas ngOnInit method is specific to Angular, especially used to define Angular bindings. Even though constructor getting called first, it is preferred to move all of your Angular bindings to ngOnInit method.
635-
In order to use ngOnInit, you need to implement OnInit interface as below,
634+
The **Constructor** is a default method of the class that is executed when the class is instantiated and ensures proper initialisation of fields in the class and its subclasses. Angular, or better Dependency Injector (DI), analyses the constructor parameters and when it creates a new instance by calling new MyClass() it tries to find providers that match the types of the constructor parameters, resolves them and passes them to the constructor.
635+
**ngOnInit** is a life cycle hook called by Angular to indicate that Angular is done creating the component.
636+
Mostly we use ngOnInit for all the initialization/declaration and avoid stuff to work in the constructor. The constructor should only be used to initialize class members but shouldn't do actual "work".
637+
So you should use constructor() to setup Dependency Injection and not much else. ngOnInit() is better place to "start" - it's where/when components' bindings are resolved.
636638
637639
```typescript
638640
export class App implements OnInit{
639-
constructor(){
641+
constructor(private myService: MyService){
640642
//called first time before the ngOnInit()
641643
}
642644
643645
ngOnInit(){
644646
//called after the constructor and called after the first ngOnChanges()
647+
//e.g. http call...
645648
}
646649
}
647650
```
@@ -1540,23 +1543,17 @@ You can download the PDF and Epub version of this repository from the latest run
15401543
**[⬆ Back to Top](#table-of-contents)**
15411544
15421545
77. ### What is JIT?
1543-
Just-in-Time (JIT) is a type of compilation that compiles your app in the browser at runtime. JIT compilation is the default when you run the ng build (build only) or ng serve (build and serve locally) CLI commands. i.e, the below commands used for JIT compilation,
1544-
1545-
```cmd
1546-
ng build
1547-
ng serve
1548-
```
1546+
Just-in-Time (JIT) is a type of compilation that compiles your app in the browser at runtime. JIT compilation was the default until Angular 8, now default is AOT. 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.
15491547
15501548
**[⬆ Back to Top](#table-of-contents)**
15511549
15521550
78. ### What is AOT?
1553-
Ahead-of-Time (AOT) is a type of compilation that compiles your app at build time. For AOT compilation, include the `--aot` option with the ng build or ng serve command as below,
1554-
1551+
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.
1552+
15551553
```cmd
1556-
ng build --aot
1557-
ng serve --aot
1554+
ng build
1555+
ng serve
15581556
```
1559-
**Note:** The ng build command with the --prod meta-flag (`ng build --prod`) compiles with AOT by default.
15601557
15611558
**[⬆ Back to Top](#table-of-contents)**
15621559
@@ -2225,7 +2222,7 @@ You can download the PDF and Epub version of this repository from the latest run
22252222
**[⬆ Back to Top](#table-of-contents)**
22262223
22272224
121. ### What is a builder?
2228-
A builder function ia a function that uses the `Architect API` to perform a complex process such as "build" or "test". The builder code is defined in an npm package. For example, BrowserBuilder runs a webpack build for a browser target and KarmaBuilder starts the Karma server and runs a webpack build for unit tests.
2225+
A builder function is a function that uses the `Architect API` to perform a complex process such as "build" or "test". The builder code is defined in an npm package. For example, BrowserBuilder runs a webpack build for a browser target and KarmaBuilder starts the Karma server and runs a webpack build for unit tests.
22292226
22302227
**[⬆ Back to Top](#table-of-contents)**
22312228
@@ -4594,4 +4591,4 @@ You can download the PDF and Epub version of this repository from the latest run
45944591
274. ### What is content projection?
45954592
Content projection is a pattern in which you insert, or project, the content you want to use inside another component.
45964593
275. ### What is ng-content and its purpose?
4597-
The ng-content is used to insert the content dynamically inside the component that helps to increase component reusability.
4594+
The ng-content is used to insert the content dynamically inside the component that helps to increase component reusability.

0 commit comments

Comments
 (0)