An open API service indexing awesome lists of open source software.

https://github.com/nadirinab/angular_pokemonapi

this repo provide a clear vision and a raodmap as a starter of angular, it cover many notions such as : CLI, Components, Services, Directives, Dependecy Injection ....
https://github.com/nadirinab/angular_pokemonapi

angular dependency-injection directive javascript routing

Last synced: 2 months ago
JSON representation

this repo provide a clear vision and a raodmap as a starter of angular, it cover many notions such as : CLI, Components, Services, Directives, Dependecy Injection ....

Awesome Lists containing this project

README

          


Image Alt Text

![Javascript](https://img.shields.io/badge/Angular-red.svg)
![Javascript](https://img.shields.io/badge/JavaScript-gold.svg)
![Javascript](https://img.shields.io/badge/component-bleusvg)
![Javascript](https://img.shields.io/badge/SPA-red.svg)
![Javascript](https://img.shields.io/badge/dataBinding-white.svg)
![Javascript](https://img.shields.io/badge/services-yellow.svg)
![Javascript](https://img.shields.io/badge/typescript-bley.svg)

## Angular :
- Angular is a platform for building web applications using TypeScript, HTML, and CSS.
- It provides tools and structures to create interactive, dynamic, and single-page applications. Angular simplifies development by offering a framework that organizes code, manages data, handles user interactions, and helps create a seamless user experience on the web.

### Few notions :

## Components:
- Components are the individual parts of an Angular application that encapsulate specific features or sections.
- They consist of : TypeScript code, HTML templates, and styles.

# Modules
- Modules are containers that group related components, directives, pipes, and services in an Angular application. They help organize and manage the overall structure of the app.

# Services:
- Services are reusable pieces of code that perform specific tasks or provide shared data and functionality across components.
- They promote code reuse and maintain a separation of concerns.

# Angular CLI :
Angular CLI provides many commands for various tasks, such as generating services, pipes, modules, and more. Here some the most common used ones :

- Create a new Angular application :

```md
ng new my-app

```

- Generate a new component::

```md
ng generate component my-component

```
- Serve the application locally: :

```md
ng serve

```

- Run unit tests: :

```md
ng test

```

# Angular templates :
Angular templates involves data binding and interpolation.

## interpolation {{ expression }}
- Interpolation is a way to output the result of an expression in the HTML template.

```md

Welcome, {{ username }}!

```

## Property Binding [property]="expression"
- Property binding allows you to set the value of an HTML element's property to the result of an expression.

```md
Image

```

## Event Binding (event)="expression"
- Event binding allows you to respond to user events (e.g., clicks, mouseovers).

```md
Click me

```

# Directives :
- Directives play a crucial role in enhancing the declarative nature of Angular templates and making it easier to build dynamic and interactive web applications, Angular has several built-in directives :
- ngIf: Conditionally rendering elements.

```md

Welcome, {{ username }}!

```

- ngFor: Iterating over a collection to generate a list of elements.

```md


  • {{ item }}


```

- ngSwitch : Switching between multiple cases based on a condition.

```md


Red

Blue

Other

```
- ngStyle : Dynamically applying styles to an element.

```md

Styled Text

```

## OnInit :
- The OnInit interface in Angular is used to define a lifecycle hook for a component.
- Specifically, the OnInit interface has a single method called ngOnInit(), which is a lifecycle hook that is called after the component has been initialized.
- this hook to perform any initialization logic needed for the component, such as fetching data, setting up subscriptions.

- The Component decorator is used to define the metadata for the component, including the selector, template, and style URLs.