4
Most read
5
Most read
6
Most read
Angular crash course
For working developers
Birhan Nega, march, 2022
Angular
● Angular is a framework and platform for building single-page apps".
● It is one of the big three frontend frameworks along with React and Vue.
● Its main building blocks include modules, services and components ,directives
● Modules have root modules and feature modules.
● Components have root components, templates, views, data binding, directives and pipes
● Services have providers and use dependency injection.
Terms to discuss
● Components
● Modules (root module, feature modules)
● Services
● View
● Template
● Data binding
● Directive
● pipes
Components
● Typescript class that interacts with a view.
● A view consists of a component and a template
● A template is HTML combined with the data-binding syntax of Angular
● The view gets updated these properties and methods in the class
1. selector: this is what your component will be in HTML
2. templateUrl: This is the view that corresponds to your template.providers:
Angular crash course
Services
● It is an injectable class which handles actions like fetching data from the
server, changing state, validating user input, or logging directly to the
console.
● Services avoid rewriting of code.
● A service can be written once and injected into all the components that
use that service
● They have @Injectable()decorator so that any component can inject them
Dependency injection
● Dependency injection is used to provide components with the services they can use.
● To define a class as a service in Angular, the @Injectable() decorator is used.
● It provides the metadata that allows Angular to inject it into a component as a
dependency.
● In the longhand method, you register an object with two properties, provide and useValue, in the
providers array of any module
● For shorthand method we can add them in providers array of the component metadata
Modules
● a place where you can group the components, directives, pipes, and
services, which are related to the application
● Angular applications are modular and Angular has its own modularity
system called NgModules
● The idea of modules comes from the single responsibility principle.
● Organizing code into modules also allows lazy loading, meaning the
modules load as needed rather than all at once on application
initialization.
● Can be root module/ feature module
● Root Module is always one and it’s called AppModule by default
Modules meta-data
An Angular module has five properties that make up its metadata
● Declarations: We can list any directives, components, or pipes here that will need to
communicate with each other.
● Imports: Pulls in any modules like the forms or router modules.
● Exports: Makes components, pipes, and directives usable in other modules that import
this one.
● Providers: Services added here become known globally to allow for dependency
injection.
● Bootstrap: Only the root module has this property. This will contain the main application
view, also called the root component.
Lifecycle hooks
Angular has a lifecycle that starts when Angular instantiates the component
class and renders the component view along with its child views.
The life cycle continues with change detection, as Angular checks to see when
data-bound properties change, and updates both the view and the
component instance as needed.
The lifecycle ends when Angular destroys the component instance and
removes its rendered template from the DOM.
Directives have a similar life cycle, as Angular creates, updates, and destroys
instances in the course of execution.
Directives
Directives are classes that add additional behavior to elements in your
Angular applications
The different types of Angular directives are as follows:
Components—directives with a template. This type of directive is the most
common directive type.
Attribute directives—directives that change the appearance or behavior of an
element, component, or another directive.
Structural directives—directives that change the DOM layout by adding and
removing DOM elements
Observables
Observable services are patterns that allow you to effectively deal with data —
allowing you to parse, modify and maintain data in an event-based system.
You can’t really escape Http and Observables because everything is data
Routing, guards
● To handle the navigation from one view to the next, you use the Angular
Router.
● If you have a login of some sort, you’re going to need route guards.
● The idea that you can protect certain views from unauthorized views is a must-
have requirement in many applications.
● Route guards act as an interface between your router and the requested
route.
● lazy-loading can also enhance your user’s experience by speeding up your
application’s load time
Pipes
● Formatting data has never been easier with Angular pipes.
● While a lot of the pre-configured and out the box pipes covers a lot of
things like dates, currency, percentages and character casing, it doesn’t
cover everything that you’ll ever need.
● That’s where custom pipes come in handy. You can create your own filters
easily and transform data formats to your liking
Component to component communication
There are 3 different communications
● Parent to Child Communication
● Child to Parent Communication
● Interaction when there is no parent-child relation
Forms
Handling user input with forms is the cornerstone of many common
applications.
Applications use forms to enable users to log in, to update a profile, to enter
sensitive information, and to perform many other data-entry tasks.
Angular provides two different approaches to handling user input through
forms: reactive and template-driven.

More Related Content

PPTX
Angular
PPTX
PPTX
Angular 14.pptx
PPTX
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
PDF
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
PPTX
Spring integration
PDF
Angular Directives
PDF
Angular
Angular 14.pptx
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular...
Spring integration
Angular Directives

What's hot (20)

PPTX
Angular
PPTX
Angular overview
PDF
Angular Pipes Workshop
PPTX
Sharing Data Between Angular Components
PDF
Angular - Chapter 7 - HTTP Services
PPTX
Angular introduction students
PPTX
Angular
PDF
Angular material
PPTX
PPTX
Angular interview questions
PDF
Developing Faster with Swagger
PPTX
Angular 2
PPTX
Angular 6 Form Validation with Material
PDF
REST API Best (Recommended) Practices
PDF
RxJS & Angular Reactive Forms @ Codemotion 2019
PDF
Java Web Services [1/5]: Introduction to Web Services
PPTX
What’s New in Angular 14?
PPTX
IdP, SAML, OAuth
PDF
Nest.js Introduction
PDF
Intro to vue.js
Angular
Angular overview
Angular Pipes Workshop
Sharing Data Between Angular Components
Angular - Chapter 7 - HTTP Services
Angular introduction students
Angular
Angular material
Angular interview questions
Developing Faster with Swagger
Angular 2
Angular 6 Form Validation with Material
REST API Best (Recommended) Practices
RxJS & Angular Reactive Forms @ Codemotion 2019
Java Web Services [1/5]: Introduction to Web Services
What’s New in Angular 14?
IdP, SAML, OAuth
Nest.js Introduction
Intro to vue.js
Ad

Similar to Angular crash course (20)

PPTX
Introduction to Angular2
PPT
17612235.ppt
PPTX
Foster - Getting started with Angular
PDF
Angular Interview Question & Answers PDF By ScholarHat
PPTX
Angular 18 course for begineers and experienced
PDF
Building blocks of Angular
PPTX
Angular Course.pptx
PPTX
What is Angular?
PPTX
Angular Framework.pptx
PPTX
How Does Angular Work?
PPTX
Angular js 1.3 presentation for fed nov 2014
PPTX
Angular Basics.pptx
PDF
Infosys Angular Interview Questions PDF By ScholarHat
ODP
Angular2
PPTX
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
PDF
Angular is a popular open-source framework for building dynamic web applicati...
PPTX
Angularjs basic part01
PPTX
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
PPT
Angular Introduction By Surekha Gadkari
PPTX
What are the key distinctions between Angular and AngularJS?
Introduction to Angular2
17612235.ppt
Foster - Getting started with Angular
Angular Interview Question & Answers PDF By ScholarHat
Angular 18 course for begineers and experienced
Building blocks of Angular
Angular Course.pptx
What is Angular?
Angular Framework.pptx
How Does Angular Work?
Angular js 1.3 presentation for fed nov 2014
Angular Basics.pptx
Infosys Angular Interview Questions PDF By ScholarHat
Angular2
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
Angular is a popular open-source framework for building dynamic web applicati...
Angularjs basic part01
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
Angular Introduction By Surekha Gadkari
What are the key distinctions between Angular and AngularJS?
Ad

Recently uploaded (20)

PDF
Cloud Native Aachen Meetup - Aug 21, 2025
PPTX
WJQSJXNAZJVCVSAXJHBZKSJXKJKXJSBHJBJEHHJB
PDF
Odoo Construction Management System by CandidRoot
PDF
What Makes a Great Data Visualization Consulting Service.pdf
PPTX
Presentation - Summer Internship at Samatrix.io_template_2.pptx
PDF
Multiverse AI Review 2025_ The Ultimate All-in-One AI Platform.pdf
PPTX
HackYourBrain__UtrechtJUG__11092025.pptx
PDF
WhatsApp Chatbots The Key to Scalable Customer Support.pdf
PPTX
Beige and Black Minimalist Project Deck Presentation (1).pptx
PPTX
DevOpsDays Halifax 2025 - Building 10x Organizations Using Modern Productivit...
PPTX
Folder Lock 10.1.9 Crack With Serial Key
PDF
Mobile App Backend Development with WordPress REST API: The Complete eBook
PDF
Coding with GPT-5- What’s New in GPT 5 That Benefits Developers.pdf
PPTX
ROI from Efficient Content & Campaign Management in the Digital Media Industry
PPTX
FLIGHT TICKET API | API INTEGRATION PLATFORM
PDF
Crypto Loss And Recovery Guide By Expert Recovery Agency.
PPTX
Independent Consultants’ Biggest Challenges in ERP Projects – and How Apagen ...
PPT
3.Software Design for software engineering
PPTX
MCP empowers AI Agents from Zero to Production
PDF
solman-7.0-ehp1-sp21-incident-management
Cloud Native Aachen Meetup - Aug 21, 2025
WJQSJXNAZJVCVSAXJHBZKSJXKJKXJSBHJBJEHHJB
Odoo Construction Management System by CandidRoot
What Makes a Great Data Visualization Consulting Service.pdf
Presentation - Summer Internship at Samatrix.io_template_2.pptx
Multiverse AI Review 2025_ The Ultimate All-in-One AI Platform.pdf
HackYourBrain__UtrechtJUG__11092025.pptx
WhatsApp Chatbots The Key to Scalable Customer Support.pdf
Beige and Black Minimalist Project Deck Presentation (1).pptx
DevOpsDays Halifax 2025 - Building 10x Organizations Using Modern Productivit...
Folder Lock 10.1.9 Crack With Serial Key
Mobile App Backend Development with WordPress REST API: The Complete eBook
Coding with GPT-5- What’s New in GPT 5 That Benefits Developers.pdf
ROI from Efficient Content & Campaign Management in the Digital Media Industry
FLIGHT TICKET API | API INTEGRATION PLATFORM
Crypto Loss And Recovery Guide By Expert Recovery Agency.
Independent Consultants’ Biggest Challenges in ERP Projects – and How Apagen ...
3.Software Design for software engineering
MCP empowers AI Agents from Zero to Production
solman-7.0-ehp1-sp21-incident-management

Angular crash course

  • 1. Angular crash course For working developers Birhan Nega, march, 2022
  • 2. Angular ● Angular is a framework and platform for building single-page apps". ● It is one of the big three frontend frameworks along with React and Vue. ● Its main building blocks include modules, services and components ,directives ● Modules have root modules and feature modules. ● Components have root components, templates, views, data binding, directives and pipes ● Services have providers and use dependency injection.
  • 3. Terms to discuss ● Components ● Modules (root module, feature modules) ● Services ● View ● Template ● Data binding ● Directive ● pipes
  • 4. Components ● Typescript class that interacts with a view. ● A view consists of a component and a template ● A template is HTML combined with the data-binding syntax of Angular ● The view gets updated these properties and methods in the class 1. selector: this is what your component will be in HTML 2. templateUrl: This is the view that corresponds to your template.providers:
  • 6. Services ● It is an injectable class which handles actions like fetching data from the server, changing state, validating user input, or logging directly to the console. ● Services avoid rewriting of code. ● A service can be written once and injected into all the components that use that service ● They have @Injectable()decorator so that any component can inject them
  • 7. Dependency injection ● Dependency injection is used to provide components with the services they can use. ● To define a class as a service in Angular, the @Injectable() decorator is used. ● It provides the metadata that allows Angular to inject it into a component as a dependency. ● In the longhand method, you register an object with two properties, provide and useValue, in the providers array of any module ● For shorthand method we can add them in providers array of the component metadata
  • 8. Modules ● a place where you can group the components, directives, pipes, and services, which are related to the application ● Angular applications are modular and Angular has its own modularity system called NgModules ● The idea of modules comes from the single responsibility principle. ● Organizing code into modules also allows lazy loading, meaning the modules load as needed rather than all at once on application initialization. ● Can be root module/ feature module ● Root Module is always one and it’s called AppModule by default
  • 9. Modules meta-data An Angular module has five properties that make up its metadata ● Declarations: We can list any directives, components, or pipes here that will need to communicate with each other. ● Imports: Pulls in any modules like the forms or router modules. ● Exports: Makes components, pipes, and directives usable in other modules that import this one. ● Providers: Services added here become known globally to allow for dependency injection. ● Bootstrap: Only the root module has this property. This will contain the main application view, also called the root component.
  • 10. Lifecycle hooks Angular has a lifecycle that starts when Angular instantiates the component class and renders the component view along with its child views. The life cycle continues with change detection, as Angular checks to see when data-bound properties change, and updates both the view and the component instance as needed. The lifecycle ends when Angular destroys the component instance and removes its rendered template from the DOM. Directives have a similar life cycle, as Angular creates, updates, and destroys instances in the course of execution.
  • 11. Directives Directives are classes that add additional behavior to elements in your Angular applications The different types of Angular directives are as follows: Components—directives with a template. This type of directive is the most common directive type. Attribute directives—directives that change the appearance or behavior of an element, component, or another directive. Structural directives—directives that change the DOM layout by adding and removing DOM elements
  • 12. Observables Observable services are patterns that allow you to effectively deal with data — allowing you to parse, modify and maintain data in an event-based system. You can’t really escape Http and Observables because everything is data
  • 13. Routing, guards ● To handle the navigation from one view to the next, you use the Angular Router. ● If you have a login of some sort, you’re going to need route guards. ● The idea that you can protect certain views from unauthorized views is a must- have requirement in many applications. ● Route guards act as an interface between your router and the requested route. ● lazy-loading can also enhance your user’s experience by speeding up your application’s load time
  • 14. Pipes ● Formatting data has never been easier with Angular pipes. ● While a lot of the pre-configured and out the box pipes covers a lot of things like dates, currency, percentages and character casing, it doesn’t cover everything that you’ll ever need. ● That’s where custom pipes come in handy. You can create your own filters easily and transform data formats to your liking
  • 15. Component to component communication There are 3 different communications ● Parent to Child Communication ● Child to Parent Communication ● Interaction when there is no parent-child relation
  • 16. Forms Handling user input with forms is the cornerstone of many common applications. Applications use forms to enable users to log in, to update a profile, to enter sensitive information, and to perform many other data-entry tasks. Angular provides two different approaches to handling user input through forms: reactive and template-driven.

Editor's Notes

  • #11: Read more here angular life cycle hooks