Skip to content

Commit

Permalink
chore: Update Angular framework description in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
manthanank committed Aug 11, 2024
1 parent 5fdaed1 commit 152d2b3
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -614,17 +614,15 @@ export class AppComponent {

## Scope

The scope of a variable in Angular refers to the context in which the variable is defined and can be accessed. There are three main types of scope in Angular:
In Angular, the scope of a variable determines where it can be accessed:

- **Global Scope** - Variables defined in the global scope are accessible from anywhere in the application. They are defined outside of any function or block of code.

- **Local Scope** - Variables defined in a function or block of code are accessible only within that function or block. They are not accessible outside of the function or block.

- **Component Scope** - Variables defined in an Angular component are accessible within that component and its child components. They are not accessible outside of the component.
- **Global Scope**: Accessible anywhere in the application.
- **Local Scope**: Accessible only within a specific function or block.
- **Component Scope**: Accessible within a component and its child components.

### Global Scope

Variables defined in the global scope are accessible from anywhere in the application. They are defined outside of any function or block of code.
Accessible from anywhere in the application; defined outside any function or block.

Example :

Expand Down Expand Up @@ -665,7 +663,7 @@ export class AppComponent {

### Local Scope

Variables defined in a function or block of code are accessible only within that function or block. They are not accessible outside of the function or block.
Accessible only within the function or block where defined.

Example :

Expand Down Expand Up @@ -707,7 +705,7 @@ export class AppComponent {

### Component Scope

Variables defined in an Angular component are accessible within that component and its child components. They are not accessible outside of the component.
Accessible within the component and its children.

Example :

Expand Down Expand Up @@ -735,11 +733,11 @@ export class AppComponent {

## View Encapsulation

View Encapsulation is a feature of Angular that allows you to control how styles are applied to components. By default, Angular uses Emulated View Encapsulation, which means that styles are scoped to the component and do not affect other components.
Controls how styles are applied to components. By default, Angular uses Emulated View Encapsulation, scoping styles to the component.

### Emulated View Encapsulation

Emulated View Encapsulation is the default mode in Angular. In this mode, Angular emulates the shadow DOM to apply styles to components. This means that styles are scoped to the component and do not affect other components.
Default mode in Angular, emulating shadow DOM to scope styles to the component.

```typescript
import { Component, ViewEncapsulation } from '@angular/core';
Expand All @@ -757,7 +755,7 @@ export class AppComponent {

### Shadow DOM View Encapsulation

Shadow DOM View Encapsulation uses the native shadow DOM to apply styles to components. This means that styles are encapsulated within the shadow DOM and do not affect other components.
Uses native shadow DOM to encapsulate styles within the component, preventing them from affecting other components.

```typescript
import { Component, ViewEncapsulation } from '@angular/core';
Expand All @@ -775,7 +773,7 @@ export class AppComponent {

### None View Encapsulation

None View Encapsulation disables view encapsulation for the component. This means that styles are not scoped to the component and can affect other components.
Disables encapsulation; styles can affect other components.

```typescript
import { Component, ViewEncapsulation } from '@angular/core';
Expand All @@ -795,7 +793,7 @@ export class AppComponent {

## Component Communication

Component communication is the process of passing data between components in an Angular application. There are several ways to achieve component communication in Angular, including Input and Output decorators, EventEmitter, and services.
Passing data between Angular components using Input/Output decorators, EventEmitter, and services.

### Parent to Child

Expand Down

0 comments on commit 152d2b3

Please sign in to comment.