SlideShare a Scribd company logo
1 of 42
What’s new in Angular 2?
A COMPARISON BETWEEN NG1.X AND NG2
Alfred Jett Grandeza
Founder, Leangineer @ Lean Consulting
leanconsulting.ph | ajgrandeza.com
Lean Consulting
• Davao based start-up
• Founded: February 2016
• Lean Academy SOON!
• More info:
• leanconsulting.ph
• fb.com/leanconsutling.ph
About Me
•Graduate of Ateneo de Davao, Computer Science 2012
•Over 5 years of software engineering experience, .NET and AngularJS
•Former CTO of T.H.E. Patrons
•Co-founder of Lean Consulting/Lean Academy
•Microsoft Technology Associate (2)
•Member of Davao .NET Community (Davao .NET Users Group, Philippine .NET Users Group)
•I do consulting and freelance work from clients overseas
•Advocate of .NET Technologies
•I LOVE TO LEARN!
Prerequisites & Tools
• Required
• JavaScript
• HTML
• CSS
• Helpful
• OOP concepts
• Visual Studio Community
• https://www.visualstudio.com/
• Visual Studio Code
• https://code.visualstudio.com/
Single Page Application
• SPAs are web apps that load a single HTML page and dynamically that page as the user interacts
• Much of the work happen in the client side
• Usually written in JavaScript
SPA Lifecycle
Angular is…
• Open source, JavaScript based front-end framework
• Used for building client-side applications
• MVW Framework (Model-View-Whatever)
• Mainly maintained by Google
Why use Angular?
• Expressive/Customizable HTML
• Powerful Data Binding
• Modular
• Easy back-end integration
Application Demo
• NG 1.X App
• NG 2 App
Key Features of Angular 1.X
• Directives
• Data binding
• Views
• Controllers
• $scope
• Modules
• Dependency Injection
• Routes
• Services
What is a directive?
• Extends HTML attributes, with the prefix “ng-”
• Teaches HTML new tricks
• There are built-in directives
• ng-app
• ng-view
• You can also create your own custom directives
Data Binding
• Interpolation
• {{name}}
• Event Binding
• ng-click=“onClick()”
• Two-way Binding
• <input ng-model=“name” />
Filters & Pipes
• Filters can be added to filter an array
•Pipes can be used to format a data
Views, Controllers, Scope
•View – UI / Display
•Controllers – Controls the logic, data and flow
•$scope is the “glue” between controller and view or the ViewModel
Modules & DI
• A container for the different parts of your Angular app
• You can package code as reusable modules
• You may inject different modules to your module
• Dependency Injection
• Instantiate a module
• ng-app=“”
• Creating a module
• angular.module(‘demoApp’, [])
Routes
• is used for deep-linking URLs to controllers and views
Services
• Are for organizing and share code across your application
Summary for NG1
Key Features
• Directives
• Data binding
• Views
• Controllers
• $scope
• Modules
• Dependency Injection
• Routes
• Services
Angular 2.0
with TypeScript
Live release: Sept 16, 2016
http://angularjs.blogspot.com/2016/09/angular2-final.html
Why Angular 2?
• Built for speed
• Modern
• Simplified API
• Enhanced Productivity
• Develop Across All Platforms
What is TypeScript?
• Open source programming language
• Developed and maintained by Microsoft
• A superset of JavaScript
• Transpiles to plain JavaScript
• Strongly typed
• Class based / OOP approach
• Learn more:
• http://www.typescriptlang.org/Playground
Setting up
• Download
• https://github.com/angular/quickstart
Angular 2 Key Features
• Components
• Templates
• Directives
• Data Binding & Pipes
• Life-cycle hooks
• Services
• Dependency Injection
• Routes
Anatomy of NG 2
Image grabbed from: https://www.pluralsight.com/courses/angular-2-getting-started
Anatomy of a Component
Image grabbed from: https://www.pluralsight.com/courses/angular-2-getting-started
Components
Image grabbed from: https://www.pluralsight.com/courses/angular-2-getting-started
Components
Import statements
Metadata & Template
Class
Decorator
• A function that adds metadata to a class
• Prefixed with an @
• @Component()
Defining a Template in a Component
• Inline template
•Linked Template
Data Binding
• Coordinates communication between the component’s class and template
• Interpolation
• {{name}}
• Event Binding
• (click)=‘onClick()’
• Two-way Binding
• <input [(ngModel)]=‘name’ />
• Property Binding
• <img [src] = ‘customer.thumbnail’ />
Directive in NG2
• Built-in directives
• *ngIf
• *ngFor
Pipes
• | lowercase
• | currency
• | uppercase
• No more filter 
• You have to create your own pipe
Lifecycle Hooks
• A component has a lifecycle
• Angular offers component lifecycle hooks that give us ability to capture these moments
• In other words, events
• Samples
• OnInit
• OnChanges
• OnDestory
Services
• Services are independent from any components
• To provide shared data, logic across multiple components
• Encapsulate external interactions (i.e. Rest API)
Services
Dependency Injection
• A design pattern to resolve dependencies
Retrieve Data using Http
Returns Observables instead of Promises
What is RxJS?
• RxJS is a javascript library for composing asynchronous & event-based programs by using
observable sequences
• Used within Angular
• More info
• http://reactivex.io/rxjs/
Promises vs Observable
• Promise
• Returns a single value
• Not cancellable
• Observable
• Works with multiple values over time
• Cancellable
• “Retryable”
• Supports map, filter, reduce, etc..
Routing
Summary
• Huge difference between NG1 & NG2, in terms of syntax
• NG2 is simpler in terms of Architecture
• TypeScript makes the job easier
References
•https://angular.io/docs/ts/latest/quickstart.html
•https://www.pluralsight.com/courses/angular-2-getting-started
•https://auth0.com/blog/angular-2-series-part-2-domain-models-and-dependency-injection/
•https://auth0.com/blog/angular-2-series-part-3-using-http/

More Related Content

What's hot

Angular js tutorial slides
Angular js tutorial slidesAngular js tutorial slides
Angular js tutorial slides
samhelman
 
AngularJS = Browser applications on steroids
AngularJS = Browser applications on steroidsAngularJS = Browser applications on steroids
AngularJS = Browser applications on steroids
Maurice De Beijer [MVP]
 

What's hot (19)

Introduction to Android Programming
Introduction to Android ProgrammingIntroduction to Android Programming
Introduction to Android Programming
 
Overview about AngularJS Framework
Overview about AngularJS Framework Overview about AngularJS Framework
Overview about AngularJS Framework
 
AngularJS
AngularJSAngularJS
AngularJS
 
AngularJS is awesome
AngularJS is awesomeAngularJS is awesome
AngularJS is awesome
 
Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013
 
Angular js tutorial slides
Angular js tutorial slidesAngular js tutorial slides
Angular js tutorial slides
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Gettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSGettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJS
 
Training On Angular Js
Training On Angular JsTraining On Angular Js
Training On Angular Js
 
Angular Seminar-js
Angular Seminar-jsAngular Seminar-js
Angular Seminar-js
 
Angular js PPT
Angular js PPTAngular js PPT
Angular js PPT
 
Angular js
Angular jsAngular js
Angular js
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day Workshop
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js
 
Angular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page ApplicationAngular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page Application
 
One Weekend With AngularJS
One Weekend With AngularJSOne Weekend With AngularJS
One Weekend With AngularJS
 
AngularJS = Browser applications on steroids
AngularJS = Browser applications on steroidsAngularJS = Browser applications on steroids
AngularJS = Browser applications on steroids
 
Kalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js TutorialsKalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js Tutorials
 
Introduction to Angular JS
Introduction to Angular JSIntroduction to Angular JS
Introduction to Angular JS
 

Viewers also liked

OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access ControlOAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
Maarten Balliauw
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)
Jef Claes
 

Viewers also liked (9)

Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
 
Introduction to HTML4
Introduction to HTML4Introduction to HTML4
Introduction to HTML4
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access ControlOAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-serviceusing ASP.NET Web API and Windows Azure Access ControlOAuth-as-a-serviceusing ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
 
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
 
29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions
 
Javaoop
JavaoopJavaoop
Javaoop
 

Similar to What's new in Angular 2?

Unlimited training using Angular p_p_t
Unlimited training  using Angular   p_p_tUnlimited training  using Angular   p_p_t
Unlimited training using Angular p_p_t
NeelaSaiKiran
 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
Goutam Dey
 

Similar to What's new in Angular 2? (20)

Angular
AngularAngular
Angular
 
Angular Live training basic to Advance
Angular Live training basic to Advance Angular Live training basic to Advance
Angular Live training basic to Advance
 
Best Angular Training Online: Angular tutorial | Learn Angular 2 to 10 |
Best Angular Training Online: Angular tutorial | Learn Angular 2 to 10 | Best Angular Training Online: Angular tutorial | Learn Angular 2 to 10 |
Best Angular Training Online: Angular tutorial | Learn Angular 2 to 10 |
 
Unlimited training using Angular p_p_t
Unlimited training  using Angular   p_p_tUnlimited training  using Angular   p_p_t
Unlimited training using Angular p_p_t
 
Mastering angular - Dot Net Tricks
Mastering angular - Dot Net TricksMastering angular - Dot Net Tricks
Mastering angular - Dot Net Tricks
 
Module2
Module2Module2
Module2
 
Angular js firebase-preso
Angular js firebase-presoAngular js firebase-preso
Angular js firebase-preso
 
Introduction to AngularJs
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJs
 
Learning AngularJS - Complete coverage of AngularJS features and concepts
Learning AngularJS  - Complete coverage of AngularJS features and conceptsLearning AngularJS  - Complete coverage of AngularJS features and concepts
Learning AngularJS - Complete coverage of AngularJS features and concepts
 
Angular2
Angular2Angular2
Angular2
 
Angular js 2
Angular js 2Angular js 2
Angular js 2
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
 
Angular js
Angular jsAngular js
Angular js
 
Angular js Online Training
Angular js Online TrainingAngular js Online Training
Angular js Online Training
 
Angular js
Angular jsAngular js
Angular js
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
 
Asp.Net MVC 5 in Arabic
Asp.Net MVC 5 in ArabicAsp.Net MVC 5 in Arabic
Asp.Net MVC 5 in Arabic
 
Angular2 with type script
Angular2 with type scriptAngular2 with type script
Angular2 with type script
 
angular-concepts-introduction-slides.pptx
angular-concepts-introduction-slides.pptxangular-concepts-introduction-slides.pptx
angular-concepts-introduction-slides.pptx
 

More from Alfred Jett Grandeza (7)

Automated testing using Selenium & NUnit
Automated testing using Selenium & NUnitAutomated testing using Selenium & NUnit
Automated testing using Selenium & NUnit
 
What’s new in VS 2017?
What’s new in VS 2017?What’s new in VS 2017?
What’s new in VS 2017?
 
Software Engineering - Trends & Industry Practices
Software Engineering - Trends & Industry PracticesSoftware Engineering - Trends & Industry Practices
Software Engineering - Trends & Industry Practices
 
Career Options for CS/IT/IS graduates
Career Options for CS/IT/IS graduatesCareer Options for CS/IT/IS graduates
Career Options for CS/IT/IS graduates
 
Software development fundamentals
Software development fundamentalsSoftware development fundamentals
Software development fundamentals
 
Introducing MS VS LightSwitch 2011
Introducing MS VS LightSwitch 2011Introducing MS VS LightSwitch 2011
Introducing MS VS LightSwitch 2011
 
Using xml in a data set (ado.net)
Using xml in a data set (ado.net)Using xml in a data set (ado.net)
Using xml in a data set (ado.net)
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

What's new in Angular 2?

  • 1. What’s new in Angular 2? A COMPARISON BETWEEN NG1.X AND NG2 Alfred Jett Grandeza Founder, Leangineer @ Lean Consulting leanconsulting.ph | ajgrandeza.com
  • 2. Lean Consulting • Davao based start-up • Founded: February 2016 • Lean Academy SOON! • More info: • leanconsulting.ph • fb.com/leanconsutling.ph
  • 3. About Me •Graduate of Ateneo de Davao, Computer Science 2012 •Over 5 years of software engineering experience, .NET and AngularJS •Former CTO of T.H.E. Patrons •Co-founder of Lean Consulting/Lean Academy •Microsoft Technology Associate (2) •Member of Davao .NET Community (Davao .NET Users Group, Philippine .NET Users Group) •I do consulting and freelance work from clients overseas •Advocate of .NET Technologies •I LOVE TO LEARN!
  • 4. Prerequisites & Tools • Required • JavaScript • HTML • CSS • Helpful • OOP concepts • Visual Studio Community • https://www.visualstudio.com/ • Visual Studio Code • https://code.visualstudio.com/
  • 5. Single Page Application • SPAs are web apps that load a single HTML page and dynamically that page as the user interacts • Much of the work happen in the client side • Usually written in JavaScript
  • 7. Angular is… • Open source, JavaScript based front-end framework • Used for building client-side applications • MVW Framework (Model-View-Whatever) • Mainly maintained by Google
  • 8. Why use Angular? • Expressive/Customizable HTML • Powerful Data Binding • Modular • Easy back-end integration
  • 9. Application Demo • NG 1.X App • NG 2 App
  • 10. Key Features of Angular 1.X • Directives • Data binding • Views • Controllers • $scope • Modules • Dependency Injection • Routes • Services
  • 11. What is a directive? • Extends HTML attributes, with the prefix “ng-” • Teaches HTML new tricks • There are built-in directives • ng-app • ng-view • You can also create your own custom directives
  • 12. Data Binding • Interpolation • {{name}} • Event Binding • ng-click=“onClick()” • Two-way Binding • <input ng-model=“name” />
  • 13. Filters & Pipes • Filters can be added to filter an array •Pipes can be used to format a data
  • 14. Views, Controllers, Scope •View – UI / Display •Controllers – Controls the logic, data and flow •$scope is the “glue” between controller and view or the ViewModel
  • 15. Modules & DI • A container for the different parts of your Angular app • You can package code as reusable modules • You may inject different modules to your module • Dependency Injection • Instantiate a module • ng-app=“” • Creating a module • angular.module(‘demoApp’, [])
  • 16. Routes • is used for deep-linking URLs to controllers and views
  • 17. Services • Are for organizing and share code across your application
  • 18. Summary for NG1 Key Features • Directives • Data binding • Views • Controllers • $scope • Modules • Dependency Injection • Routes • Services
  • 19. Angular 2.0 with TypeScript Live release: Sept 16, 2016 http://angularjs.blogspot.com/2016/09/angular2-final.html
  • 20. Why Angular 2? • Built for speed • Modern • Simplified API • Enhanced Productivity • Develop Across All Platforms
  • 21. What is TypeScript? • Open source programming language • Developed and maintained by Microsoft • A superset of JavaScript • Transpiles to plain JavaScript • Strongly typed • Class based / OOP approach • Learn more: • http://www.typescriptlang.org/Playground
  • 22. Setting up • Download • https://github.com/angular/quickstart
  • 23. Angular 2 Key Features • Components • Templates • Directives • Data Binding & Pipes • Life-cycle hooks • Services • Dependency Injection • Routes
  • 24. Anatomy of NG 2 Image grabbed from: https://www.pluralsight.com/courses/angular-2-getting-started
  • 25. Anatomy of a Component Image grabbed from: https://www.pluralsight.com/courses/angular-2-getting-started
  • 26. Components Image grabbed from: https://www.pluralsight.com/courses/angular-2-getting-started
  • 28. Decorator • A function that adds metadata to a class • Prefixed with an @ • @Component()
  • 29. Defining a Template in a Component • Inline template •Linked Template
  • 30. Data Binding • Coordinates communication between the component’s class and template • Interpolation • {{name}} • Event Binding • (click)=‘onClick()’ • Two-way Binding • <input [(ngModel)]=‘name’ /> • Property Binding • <img [src] = ‘customer.thumbnail’ />
  • 31. Directive in NG2 • Built-in directives • *ngIf • *ngFor
  • 32. Pipes • | lowercase • | currency • | uppercase • No more filter  • You have to create your own pipe
  • 33. Lifecycle Hooks • A component has a lifecycle • Angular offers component lifecycle hooks that give us ability to capture these moments • In other words, events • Samples • OnInit • OnChanges • OnDestory
  • 34. Services • Services are independent from any components • To provide shared data, logic across multiple components • Encapsulate external interactions (i.e. Rest API)
  • 36. Dependency Injection • A design pattern to resolve dependencies
  • 37. Retrieve Data using Http Returns Observables instead of Promises
  • 38. What is RxJS? • RxJS is a javascript library for composing asynchronous & event-based programs by using observable sequences • Used within Angular • More info • http://reactivex.io/rxjs/
  • 39. Promises vs Observable • Promise • Returns a single value • Not cancellable • Observable • Works with multiple values over time • Cancellable • “Retryable” • Supports map, filter, reduce, etc..
  • 41. Summary • Huge difference between NG1 & NG2, in terms of syntax • NG2 is simpler in terms of Architecture • TypeScript makes the job easier