8- Angular - Getting Started With Angular
8- Angular - Getting Started With Angular
Framework
Sayed Taha, PhD
Contents
• What is the Angular?
• Single-Page-Applications
• Angular Development Timeline
• IDE and tools.
• TypeScript-in-action
• Angular-in-action.
Angular-in-action.
Angular
• Framework for building modern single page applications.
• Official documentation is @ www, angular.io
• Main features:-
• Provides clean separation of HTML (template) coding and business
logic
• Component-based framework
• Supports data-binding and inversion of control (IOC) of control /
dependency injection (DI)
• Supports responsive design via simple integration with modern
framework such as Bootstrap
Architectural view of Angular
• Angular is a component based modularized framework
MODULES
C1 C2 Cn
Directives
Angular Key Players
• Component: is the main player in the framework and composed of
• View: represents the user interface.
• Class: contains the client-side business logic, and view events handlers.
Angular Backend
Services DB
(Components) (Spring Boot)
Angular Project Files view
• Any angular project is composed of the following set of files
categories
• HTML
• CSS
• Assests
• Images
• …
• TS
• Config
Angular CLI Commonly Used Commands
• Checking the installed Angular version
• ng version current is 16.2.10 release on 18-OCT-23
Angular CLI Useful Commands
• Angular help
• ng help
Angular Project Creation
• Angular CLI helps to generate the project by executing the following command:
• The port option specifying the port on which the project will run
• Default port is 4200
• Default project path on the server is http://localhost:4200
• Using the open option will open the browser for you.
Angular Project Running
Angular Project Files details
• One you issued ng new command you
should get the following project view in the
VS Code explorer.
Angular Project Files details
Environments
Angular app configuration
: profiles for different
& list of env.;
execution
dev, test,
targets
prod
Index.html : End
maintobootstrap
End testing
/ launch page
Polyfill.ts: enables
Local support
repository for for
nodedifferent
modulesbrowsers
Project meta-data
Test.ts:/ set
nodeof dependencies
unit test cases(maven like)
• Boorstrp/entry-point component
• providers:[]
• Services for provided in DI
Angular First Project
• Lets create a students grade table such as the
one shown.
• We have to follow the following steps:
1. Create new project
2. Edit the main template page
3. Generate new Component
4. Add the new component selector to the app template
5. Create students class
6. In the new component, create test array of students
7. In the new component HTML template loop over the
students list to build the shown table.
Step 1: create the project
• ng new students-project
Step 2: update the main template page
• Remove all the generated place holders and
add your own HTML
Step 3: create new component
• Using the CLI command
• ng generate component students-list
• ng g c students-list