SlideShare a Scribd company logo
Scott Lee
User Management Program
• Model Design
• Service Design
• UI Design
Model
• Class User
– ID
– Full Name
– Employee ID
– Role
Service
• List
• Get by ID
• Save
• Create
• Delete
• Search by …
UI
• List All Page
• View/Update Page
Angular 4 Introduction Tutorial
Existing Solution
• Javascript with Jquery, AngularJS 1.x
• Javascript for UI
• Data binding with DOM or Scope
• Javascript calls HTTP REST API on Server
• Java for Server side logic
• Data Access through Service Layer in Java
Issues
• Unorganized Javascript
• Difficult to track the logic in Javascript
• Complex inter-dependecy in Javascript
• Slow loading
• Long learning curve for Angular 1 and JQuery
•
AngularJS 1.x design
public interface ClientMasterRestFields
{
enum ClientDetail {
PARTY_ID,
ONTRAC_ID,
GOLDTIER_ID,
Address,
ShortCode,
AccountDetail,
UPDATED_BY,
};
enum Address {
SAME_AS_REGISTERED,
ADDRESS_LINE1,
ADDRESS_LINE2,
ADDRESS_LINE3,
CITY,
…
PETR_ADDR_ID,
VERSION,
CONFIRMATION_ID,
ENTITY_STATUS,
};
enum AccountDetail {
ACCOUNT_ID,
PARTY_ID,
ONTRAC_ID,
GOLDTIER_ID,
GOLDTIER_ACCOUNT_ID,
PRODUCT_TYPE,
PRODUCT_RANGE,
ShortCode,
Address,
ContactInfo,
OtherInfo,
PRIMARY_IDX,
VERSION,
XREF_ID,
UPDATED_BY,
ACKNOWLEDGE_MSG,
};
enum ShortCode {
XREF_ID,
ACCOUNT_ID,
EXTERNAL_SYSTEM_CODE,
EXTERNAL_SYSTEM_NAME,
EXTERNAL_KEY,
ACCOUNT_REF,
GOLDTIER_ACCOUNT_ID,
STATUS,
VERSION,
ENTITY_STATUS,
PRODUCT_TYPE_CODE,
PRODUCT_RANGE_CODE,
};
enum ContactInfo {
CONF_CONTACT_ID,
CONTACT_ID,
PETR_ADDR_ID,
CONTACT_ADD_ID,
FIRST_NAME,
LAST_NAME,
PHONE_NUMBER,
PHONE_EXT,
FAX_NUMBER,
EMAIL,
VERSION,
ADDRESS_VERSION,
ENTITY_STATUS
};
enum OtherInfo {
MFX_CNTRPRTY_TYPE,
MFX_CPTY_CLASS,
MFX_US_BRNCH,
MFX_CA_BRNCH,
MFX_SALES_BRNCH,
MFX_MRGN_OWNR,
MFX_REV_SHRNG_ID,
MFX_PYMNT_SUSP,
WIRE_FEE,
STTLMNT_NET_EMAIL,
LANGUAGE_PREFERENCE,
};
enum PropInfo {
VALUE,
XPREF_PROP_ID,
VERSION,
ENTITY_STATUS
};
}
Angular 2 without Angular 1.x
• Angular2 is totally new concept
• Easy to understand for OOP
• Faster
• Modular with more OO Like for Cleaner Code
New in Angular2
• No two way bindings
• TypeScript
• Dependency Injection
• No Controller  Component
• Angular CLI
Get started – Hello User
Install angular CLI
1. @Setup :: You should update your Angular cli version before cloning sample program
2. npm uninstall -g @angular/cli angular-cli
npm cache clean
npm install -g @angular/cli@latest
($ npm install -g @angular/cli)
New Project
1. C:angular2ng new hello-user
2. @test blank app :: ng serve
3. @index.html
4. @src/main.ts
5. @ platformBrowserDynamic().bootstrapModule(AppModule);
6. @ app.component.ts
7. @ AppComponent
Design
ng generate interface user
ng generate component --inline-template people-list
Add Components
• ng generate interface user
• ng generate component --inline-template
user-list
• Update User List component
User : Model
User List : Component
User List
Component
Service Layer
user-list.component.ts user.ts
User Manager
Service
Presentation Layer
Creating The
UserManagerService
• ng generate service userManager –module
app
• Implement 'getAll()' method
• Dependency Injection to UserList Component
• ng generate service userManager --module
app
UserManagerService
Register Service to
AppComponent
Angular 2 Component Lifecycle
Angular 4 Introduction Tutorial
Dependency of sources
• index.html :: <app-root>
• app.component.ts
• user-list.component.ts
• user.ts
Service
• UserManagerService
• Register Service in app module
• Register Service in app component
Angular 4 Introduction Tutorial
Extracting User Details Into
Its Own Component
• ng g c –it –is user-details
• ng generate component --inline-template --
inline-style user-details
Data Binding
• Event Binding : Component to Template :
(click) – selectUser(user)
• Property Binding : Property (Interface) to
Component
• UserDetailsComponent
Routing
Forms and Validation
Next …
Run sample
@Setup :: You should update your Angular cli version before cloning sample program
npm uninstall -g @angular/cli angular-cli
npm cache clean
npm install -g @angular/cli@latest
@Download sample :: git clone https://github.com/Vintharas/angular2-step-by-step-01-your-first-component
:: C:angular2
:: Go to new directory : C:angular2angular2-step-by-step-01-your-first-component>ng build
:: npm install
@ Running Server
:: ng serve
@ Test on Browser
:: http://localhost:4200/
@Blog :: Angular 2 code samples for the blog post Angular 2 Step by Step Your First Component
http://www.barbarianmeetscoding.com/blog/2016/03/25/getting-started-with-angular-2-step-by-step-1-your-
first-component/
Reference
• 1st week : https://www.barbarianmeetscoding.com/blog/2016/03/25/getting-started-with-angular-2-step-
by-step-1-your-first-component/
• 2nd week : service : https://www.barbarianmeetscoding.com/blog/2016/03/26/getting-started-with-
angular-2-step-by-step-2-refactoring-to-services/
• 3rd week : data binding : https://www.barbarianmeetscoding.com/blog/2016/03/27/getting-started-with-
angular-2-step-by-step-3-your-second-component-and-angular-2-data-binding/
• 4th week : routing : https://www.barbarianmeetscoding.com/blog/2016/03/28/getting-started-with-
angular-2-step-by-step-4-routing/
• 5th week : forms and validation : https://www.barbarianmeetscoding.com/blog/2016/03/29/getting-
started-with-angular-2-step-by-step-5-forms-and-validation/
• Connecting Angular 2 Front to MongoDB : http://adrianmejia.com/blog/2014/10/03/mean-stack-tutorial-
mongodb-expressjs-angularjs-nodejs/
• Editor : Visual Studio Code - https://code.visualstudio.com/docs/?dv=win

More Related Content

ODP
Angular 6 - The Complete Guide
PPTX
Angular 2
PPSX
Angular 4 fronts
PDF
Developing a Demo Application with Angular 4 - J2I
PPTX
Introduction to angular 2
PDF
What Is Angular 2 | Angular 2 Tutorial For Beginners | Angular Training | Edu...
PDF
What angular 13 will bring to the table
PPTX
Angular 6 - The Complete Guide
Angular 2
Angular 4 fronts
Developing a Demo Application with Angular 4 - J2I
Introduction to angular 2
What Is Angular 2 | Angular 2 Tutorial For Beginners | Angular Training | Edu...
What angular 13 will bring to the table

What's hot (20)

PPTX
PPTX
Angular JS, steal the idea
PDF
Angular, the New Angular JS
PDF
Angular 4 for Java Developers
PDF
Angular 2 - Core Concepts
PDF
Introduction to Angular 2
PDF
Mastering angular - Dot Net Tricks
PPTX
AngularJS2 / TypeScript / CLI
PDF
Angular 2: core concepts
PDF
What is Angular version 4?
PPTX
Talk for DevFest 2021 - GDG Bénin
PDF
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
PDF
What's New in Angular 4 | Angular 4 Features | Angular 4 Changes | Angular Tu...
PDF
Angular Meetup 1 - Angular Basics and Workshop
PPTX
Angular 9
PDF
Introduction to angular 4
PPTX
PDF
Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...
PPTX
Introduction to Angular 2
PDF
Introduction to Angular 2
Angular JS, steal the idea
Angular, the New Angular JS
Angular 4 for Java Developers
Angular 2 - Core Concepts
Introduction to Angular 2
Mastering angular - Dot Net Tricks
AngularJS2 / TypeScript / CLI
Angular 2: core concepts
What is Angular version 4?
Talk for DevFest 2021 - GDG Bénin
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
What's New in Angular 4 | Angular 4 Features | Angular 4 Changes | Angular Tu...
Angular Meetup 1 - Angular Basics and Workshop
Angular 9
Introduction to angular 4
Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...
Introduction to Angular 2
Introduction to Angular 2
Ad

Similar to Angular 4 Introduction Tutorial (20)

PPTX
Angular js for Beginnners
PPTX
Moving From AngularJS to Angular 2
PPTX
ITSC Internship Presentation
PDF
Azure Application insights - An Introduction
PPTX
Tech io spa_angularjs_20130814_v0.9.5
PDF
Medium TechTalk — iOS
PPTX
MongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
PDF
Introducing Rendr: Run your Backbone.js apps on the client and server
PDF
Frontend APIs powering fast paced product iterations
PPTX
Valentine with Angular js - Introduction
PPTX
Angular js 2
PPTX
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
PDF
Component-based Front-End architecture
PDF
Mini-Training: AngularJS
PPTX
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
DOC
Harish Resume
PPTX
Angularjs Basics
PPTX
Tokyo Azure Meetup #14 - Azure Functions Proxies
PPTX
Large-Scale Web Development with JavaScript
PPTX
Android development course in pune ppt.
Angular js for Beginnners
Moving From AngularJS to Angular 2
ITSC Internship Presentation
Azure Application insights - An Introduction
Tech io spa_angularjs_20130814_v0.9.5
Medium TechTalk — iOS
MongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
Introducing Rendr: Run your Backbone.js apps on the client and server
Frontend APIs powering fast paced product iterations
Valentine with Angular js - Introduction
Angular js 2
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
Component-based Front-End architecture
Mini-Training: AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
Harish Resume
Angularjs Basics
Tokyo Azure Meetup #14 - Azure Functions Proxies
Large-Scale Web Development with JavaScript
Android development course in pune ppt.
Ad

More from Scott Lee (6)

PPT
Basic Object Oriented Concepts
PPTX
Mean full stack development
KEY
Resilience 위기관리능력, 캐나다행 토크쇼
KEY
Serendipity, 행운을 가져오는 능력, 캐나다 취업유학
PPT
캐나다유학을 통해서 취업하는 방법 - 캐나다교육박람회 2011
KEY
Canada education marketing in korea
Basic Object Oriented Concepts
Mean full stack development
Resilience 위기관리능력, 캐나다행 토크쇼
Serendipity, 행운을 가져오는 능력, 캐나다 취업유학
캐나다유학을 통해서 취업하는 방법 - 캐나다교육박람회 2011
Canada education marketing in korea

Recently uploaded (20)

PPTX
Funds Management Learning Material for Beg
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PPTX
artificial intelligence overview of it and more
PPTX
Internet___Basics___Styled_ presentation
PPTX
QR Codes Qr codecodecodecodecocodedecodecode
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
PPTX
Introuction about ICD -10 and ICD-11 PPT.pptx
PDF
Triggering QUIC, presented by Geoff Huston at IETF 123
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PPTX
international classification of diseases ICD-10 review PPT.pptx
PPTX
presentation_pfe-universite-molay-seltan.pptx
PDF
Testing WebRTC applications at scale.pdf
PPTX
Introduction to Information and Communication Technology
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PPTX
innovation process that make everything different.pptx
Funds Management Learning Material for Beg
Job_Card_System_Styled_lorem_ipsum_.pptx
artificial intelligence overview of it and more
Internet___Basics___Styled_ presentation
QR Codes Qr codecodecodecodecocodedecodecode
PptxGenJS_Demo_Chart_20250317130215833.pptx
Tenda Login Guide: Access Your Router in 5 Easy Steps
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
An introduction to the IFRS (ISSB) Stndards.pdf
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
RPKI Status Update, presented by Makito Lay at IDNOG 10
Introuction about ICD -10 and ICD-11 PPT.pptx
Triggering QUIC, presented by Geoff Huston at IETF 123
522797556-Unit-2-Temperature-measurement-1-1.pptx
international classification of diseases ICD-10 review PPT.pptx
presentation_pfe-universite-molay-seltan.pptx
Testing WebRTC applications at scale.pdf
Introduction to Information and Communication Technology
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
innovation process that make everything different.pptx

Angular 4 Introduction Tutorial

  • 2. User Management Program • Model Design • Service Design • UI Design
  • 3. Model • Class User – ID – Full Name – Employee ID – Role
  • 4. Service • List • Get by ID • Save • Create • Delete • Search by …
  • 5. UI • List All Page • View/Update Page
  • 7. Existing Solution • Javascript with Jquery, AngularJS 1.x • Javascript for UI • Data binding with DOM or Scope • Javascript calls HTTP REST API on Server • Java for Server side logic • Data Access through Service Layer in Java
  • 8. Issues • Unorganized Javascript • Difficult to track the logic in Javascript • Complex inter-dependecy in Javascript • Slow loading • Long learning curve for Angular 1 and JQuery •
  • 10. public interface ClientMasterRestFields { enum ClientDetail { PARTY_ID, ONTRAC_ID, GOLDTIER_ID, Address, ShortCode, AccountDetail, UPDATED_BY, }; enum Address { SAME_AS_REGISTERED, ADDRESS_LINE1, ADDRESS_LINE2, ADDRESS_LINE3, CITY, … PETR_ADDR_ID, VERSION, CONFIRMATION_ID, ENTITY_STATUS, }; enum AccountDetail { ACCOUNT_ID, PARTY_ID, ONTRAC_ID, GOLDTIER_ID, GOLDTIER_ACCOUNT_ID, PRODUCT_TYPE, PRODUCT_RANGE, ShortCode, Address, ContactInfo, OtherInfo, PRIMARY_IDX, VERSION, XREF_ID, UPDATED_BY, ACKNOWLEDGE_MSG, }; enum ShortCode { XREF_ID, ACCOUNT_ID, EXTERNAL_SYSTEM_CODE, EXTERNAL_SYSTEM_NAME, EXTERNAL_KEY, ACCOUNT_REF, GOLDTIER_ACCOUNT_ID, STATUS, VERSION, ENTITY_STATUS, PRODUCT_TYPE_CODE, PRODUCT_RANGE_CODE, }; enum ContactInfo { CONF_CONTACT_ID, CONTACT_ID, PETR_ADDR_ID, CONTACT_ADD_ID, FIRST_NAME, LAST_NAME, PHONE_NUMBER, PHONE_EXT, FAX_NUMBER, EMAIL, VERSION, ADDRESS_VERSION, ENTITY_STATUS }; enum OtherInfo { MFX_CNTRPRTY_TYPE, MFX_CPTY_CLASS, MFX_US_BRNCH, MFX_CA_BRNCH, MFX_SALES_BRNCH, MFX_MRGN_OWNR, MFX_REV_SHRNG_ID, MFX_PYMNT_SUSP, WIRE_FEE, STTLMNT_NET_EMAIL, LANGUAGE_PREFERENCE, }; enum PropInfo { VALUE, XPREF_PROP_ID, VERSION, ENTITY_STATUS }; }
  • 11. Angular 2 without Angular 1.x • Angular2 is totally new concept • Easy to understand for OOP • Faster • Modular with more OO Like for Cleaner Code
  • 12. New in Angular2 • No two way bindings • TypeScript • Dependency Injection • No Controller  Component • Angular CLI
  • 13. Get started – Hello User Install angular CLI 1. @Setup :: You should update your Angular cli version before cloning sample program 2. npm uninstall -g @angular/cli angular-cli npm cache clean npm install -g @angular/cli@latest ($ npm install -g @angular/cli) New Project 1. C:angular2ng new hello-user 2. @test blank app :: ng serve 3. @index.html 4. @src/main.ts 5. @ platformBrowserDynamic().bootstrapModule(AppModule); 6. @ app.component.ts 7. @ AppComponent
  • 14. Design ng generate interface user ng generate component --inline-template people-list
  • 15. Add Components • ng generate interface user • ng generate component --inline-template user-list • Update User List component
  • 17. User List : Component
  • 18. User List Component Service Layer user-list.component.ts user.ts User Manager Service Presentation Layer
  • 19. Creating The UserManagerService • ng generate service userManager –module app • Implement 'getAll()' method • Dependency Injection to UserList Component • ng generate service userManager --module app
  • 22. Angular 2 Component Lifecycle
  • 24. Dependency of sources • index.html :: <app-root> • app.component.ts • user-list.component.ts • user.ts
  • 25. Service • UserManagerService • Register Service in app module • Register Service in app component
  • 27. Extracting User Details Into Its Own Component • ng g c –it –is user-details • ng generate component --inline-template -- inline-style user-details
  • 28. Data Binding • Event Binding : Component to Template : (click) – selectUser(user) • Property Binding : Property (Interface) to Component • UserDetailsComponent
  • 32. Run sample @Setup :: You should update your Angular cli version before cloning sample program npm uninstall -g @angular/cli angular-cli npm cache clean npm install -g @angular/cli@latest @Download sample :: git clone https://github.com/Vintharas/angular2-step-by-step-01-your-first-component :: C:angular2 :: Go to new directory : C:angular2angular2-step-by-step-01-your-first-component>ng build :: npm install @ Running Server :: ng serve @ Test on Browser :: http://localhost:4200/ @Blog :: Angular 2 code samples for the blog post Angular 2 Step by Step Your First Component http://www.barbarianmeetscoding.com/blog/2016/03/25/getting-started-with-angular-2-step-by-step-1-your- first-component/
  • 33. Reference • 1st week : https://www.barbarianmeetscoding.com/blog/2016/03/25/getting-started-with-angular-2-step- by-step-1-your-first-component/ • 2nd week : service : https://www.barbarianmeetscoding.com/blog/2016/03/26/getting-started-with- angular-2-step-by-step-2-refactoring-to-services/ • 3rd week : data binding : https://www.barbarianmeetscoding.com/blog/2016/03/27/getting-started-with- angular-2-step-by-step-3-your-second-component-and-angular-2-data-binding/ • 4th week : routing : https://www.barbarianmeetscoding.com/blog/2016/03/28/getting-started-with- angular-2-step-by-step-4-routing/ • 5th week : forms and validation : https://www.barbarianmeetscoding.com/blog/2016/03/29/getting- started-with-angular-2-step-by-step-5-forms-and-validation/ • Connecting Angular 2 Front to MongoDB : http://adrianmejia.com/blog/2014/10/03/mean-stack-tutorial- mongodb-expressjs-angularjs-nodejs/ • Editor : Visual Studio Code - https://code.visualstudio.com/docs/?dv=win