Pipes in Angular

1. What is a Pipe? A pipe takes in data as input and transforms it into a desired output for display in the template. It's similar to a filter in other frameworks. Example: <p>{{ birthday | date:'longDate' }}</p> <p>{{ birthday | date:'longDate' }}</p> Here, the date pipe transforms a Date object into a readable…

0 Comments

Directives in Angular

In Angular, directives are classes that add behavior to elements in the DOM. There are two main types: Structural Directives – change the DOM structure (add/remove elements). Examples: *ngIf, *ngFor. Attribute Directives – change the appearance or behavior of an element. Examples: [ngClass], [ngStyle]. 1. Structural Directives *ngIf Conditionally renders elements. <p *ngIf="isLoggedIn"> Welcome,…

0 Comments

Decorator in Angular

In Angular, a decorator is a special kind of declaration that attaches metadata to a class, method, property, or parameter. Angular uses decorators extensively to understand how different pieces of your application should work. They are just functions prefixed with @ that tell Angular how to treat a class or element. Common Angular Decorators…

0 Comments

Components in Angular

In Angular, a component is the fundamental building block of the user interface (UI). Structure of a Component A component is made up of three main parts: TypeScript class – contains properties (data) and methods (logic). HTML template – defines what gets rendered on the page. CSS/SCSS styles – optional styles for that component’s…

0 Comments

Modules in Angular

In Angular, a module is a way to organize an application into cohesive blocks of functionality. 👉 Technically, a module in Angular is defined using the @NgModule decorator.It tells Angular how to compile and launch your application. Key Points about Angular Modules: Root Module (AppModule) Every Angular app has at least one module, called…

0 Comments

Angular project structure

In Angular, a project typically follows a well-defined structure that is generated when you run ng new my-appng new my-app Here’s the standard Angular project structure and what each part does: Root Level my-app/ ├── node_modules/ # Installed npm dependencies ├── src/ # Application source code ├── angular.json # Angular workspace configuration ├── package.json…

0 Comments

Angular CLI

The Angular CLI (Command Line Interface) is a tool to initialize, develop, scaffold, and maintain Angular applications. 🔹 Installation npm install -g @angular/cli npm install -g @angular/cli Check version: ng version ng version 🔹 Common Angular CLI Commands 1. Create a new Angular project ng new my-appng new my-app 👉 Creates a new project…

0 Comments

Aggregate functions in SQL

In SQL, aggregate functions are functions that perform a calculation on a set of values and return a single value. They’re commonly used with the GROUP BY clause to summarize data. Common Aggregate Functions COUNT() – Counts the number of rows SUM() – Returns the total sum of a numeric column AVG() – Returns…

0 Comments

Sorting and limiting data

🔹 Sorting (ORDER BY) You use ORDER BY to arrange query results: SELECT column1, column2 FROM table_name ORDER BY column1 ASC; -- ascending (default) SELECT column1, column2 FROM table_name ORDER BY column1 ASC; -- ascending (default) SELECT column1, column2 FROM table_name ORDER BY column1 DESC; -- descending SELECT column1, column2 FROM table_name ORDER BY…

0 Comments

Querying data in SQL

Querying data in SQL usually means retrieving information from a database using the SELECT statement. Let me give you a structured overview with examples: 🔹 Basic Query SELECT column1, column2 FROM table_name; SELECT column1, column2 FROM table_name; SELECT → specifies the columns you want FROM → specifies the table Example: SELECT first_name, last_name FROM…

0 Comments

End of content

No more pages to load